diff --git a/code/modules/mob/living/simple_animal/damage_procs.dm b/code/modules/mob/living/simple_animal/damage_procs.dm index be113d9201f..922ddc61bf1 100644 --- a/code/modules/mob/living/simple_animal/damage_procs.dm +++ b/code/modules/mob/living/simple_animal/damage_procs.dm @@ -1,11 +1,22 @@ - +/** + * Adjusts the health of a simple mob by a set amount and wakes AI if its idle to react + * + * Arguments: + * * amount The amount that will be used to adjust the mob's health + * * updating_health If the mob's health should be immediately updated to the new value + * * forced If we should force update the adjustment of the mob's health no matter the restrictions, like GODMODE + */ /mob/living/simple_animal/proc/adjustHealth(amount, updating_health = TRUE, forced = FALSE) - if(!forced && (status_flags & GODMODE)) - return FALSE - bruteloss = round(clamp(bruteloss + amount, 0, maxHealth * 2), DAMAGE_PRECISION) - if(updating_health) - updatehealth() - return amount + . = FALSE + if(forced || !(status_flags & GODMODE)) + bruteloss = round(clamp(bruteloss + amount, 0, maxHealth * 2), DAMAGE_PRECISION) + if(updating_health) + updatehealth() + . = amount + if(ckey || stat) + return + if(AIStatus == AI_IDLE) + toggle_ai(AI_ON) /mob/living/simple_animal/adjustBruteLoss(amount, updating_health = TRUE, forced = FALSE) if(forced) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index c99709fd718..beedeea489d 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -705,13 +705,6 @@ if (pulledby || shouldwakeup) toggle_ai(AI_ON) -/mob/living/simple_animal/adjustHealth(amount, updating_health = TRUE, forced = FALSE) - . = ..() - if(!ckey && !stat)//Not unconscious - if(AIStatus == AI_IDLE) - toggle_ai(AI_ON) - - /mob/living/simple_animal/onTransitZ(old_z, new_z) ..() if (AIStatus == AI_Z_OFF)