mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-05 23:12:26 +00:00
Merge pull request #6492 from Mechoid/FixDivbyZeroSeriouslyHowDidIDoThat
Fix The Zeros
This commit is contained in:
@@ -1630,7 +1630,7 @@
|
||||
if(R.volume >= R.overdose)
|
||||
temp = PULSE_NONE
|
||||
|
||||
return round(temp * brain_modifier)
|
||||
return max(0, round(temp * brain_modifier))
|
||||
|
||||
/mob/living/carbon/human/proc/handle_heartbeat()
|
||||
if(pulse == PULSE_NONE)
|
||||
|
||||
@@ -131,10 +131,7 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
|
||||
..()
|
||||
|
||||
/obj/item/organ/internal/brain/proc/get_control_efficiency()
|
||||
. = 0
|
||||
|
||||
if(!is_broken())
|
||||
. = 1 - (round(damage / max_damage * 10) / 10)
|
||||
. = max(0, 1 - (round(damage / max_damage * 10) / 10))
|
||||
|
||||
return .
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
if(owner.internal_organs_by_name[O_BRAIN]) // As the brain starts having Trouble, the lungs start malfunctioning.
|
||||
var/obj/item/organ/internal/brain/Brain = owner.internal_organs_by_name[O_BRAIN]
|
||||
if(Brain.get_control_efficiency() <= 0.8)
|
||||
if(prob(4 / Brain.get_control_efficiency()))
|
||||
if(prob(4 / max(0.1,Brain.get_control_efficiency())))
|
||||
spawn owner.emote("me", 1, "gasps for air!")
|
||||
owner.AdjustLosebreath(round(3 / Brain.get_control_efficiency()))
|
||||
owner.AdjustLosebreath(round(3 / max(0.1,Brain.get_control_efficiency())))
|
||||
|
||||
/obj/item/organ/internal/lungs/proc/rupture()
|
||||
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
|
||||
|
||||
Reference in New Issue
Block a user