Files
SyncIt21 7c5ef1cfb8 Removes unused parameter times_fired from mob procs (#94590)
## About The Pull Request
What it says on the tin. `times_fired` is the most unused parameter in
all mob procs. I say most because there were just 2 cases where it was
used
- handling breathing
- handling heartbeat

Besides these 2 cases this parameter did nothing in every proc. Removing
it does 2 things
- Makes those procs more readable as it now has 1 less parameter that
was documented poorly and did nothing
- Makes those procs slightly faster as we are passing 1 less variable to
its parameter call stack

It can easily be substituted with `SSmobs.times_fired` which was its
original value anyways

## Changelog
🆑
code: removes an unused parameter `times_fired` from mob life procs.
Making them function slightly faster
/🆑
2025-12-26 09:51:33 -05:00

39 lines
995 B
Plaintext

/mob/living/brain/Life(seconds_per_tick = SSMOBS_DT)
if(isnull(loc) || HAS_TRAIT(src, TRAIT_NO_TRANSFORM))
return
if(!isnull(container))
if(!istype(container))
stack_trace("/mob/living/brain with container set, but container was not an MMI!")
container = null
if(!container.contains(src))
stack_trace("/mob/living/brain with container set, but we weren't inside of it!")
container = null
. = ..()
handle_emp_damage(seconds_per_tick)
/mob/living/brain/update_stat()
if(HAS_TRAIT(src, TRAIT_GODMODE))
return
if(health > HEALTH_THRESHOLD_DEAD)
return
if(stat != DEAD)
death()
var/obj/item/organ/brain/BR
if(container?.brain)
BR = container.brain
else if(istype(loc, /obj/item/organ/brain))
BR = loc
if(BR)
BR.set_organ_damage(BRAIN_DAMAGE_DEATH) //beaten to a pulp
/mob/living/brain/proc/handle_emp_damage(seconds_per_tick)
if(!emp_damage)
return
if(stat == DEAD)
emp_damage = 0
else
emp_damage = max(emp_damage - (0.5 * seconds_per_tick), 0)