mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Ports Polaris #6492
Fixes a divide by zero issue with brain damage and pulse.
This commit is contained in:
@@ -131,12 +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)
|
||||
|
||||
return .
|
||||
. = max(0, 1 - (round(damage / max_damage * 10) / 10))
|
||||
|
||||
/obj/item/organ/internal/brain/pariah_brain
|
||||
name = "brain remnants"
|
||||
|
||||
@@ -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