Files
Bubberstation/code/modules/pai/death.dm
Mothblocks 0235cfb078 Experiment with holding hard references to objects being qdeleted in 515 (saves 1.1+ seconds on init times, more on prod) (#72033)
## About The Pull Request
Adds `EXPERIMENT_515_QDEL_HARD_REFERENCE`, which will queue to the GC
subsystem using hard references rather than `\ref`. This is only
possible in 515 because of the new `refcount` proc. `\ref` is very very
slow and has some nasty knock on effects, so removing its usages where
possible is good.

This is an explicit opt in define because I want to give us the ability
to test 515 on live while only testing 515 itself, not our experimental
changes. We have a few more of these we want to do so I made a separate
file for them. They're auto-defined in unit tests so we see them with
the alternate test runner. In a perfect world we'd test both on and off,
but eh.

Closes https://github.com/tgstation/dev-cycles-initiative/issues/10
2022-12-27 08:04:49 +00:00

20 lines
472 B
Plaintext

/mob/living/silicon/pai/death(gibbed)
if(stat == DEAD)
return
set_stat(DEAD)
update_sight()
clear_fullscreens()
/**
* New pAI's get a brand new mind to prevent meta stuff from their previous
* life. This new mind causes problems down the line if it's not deleted here.
*/
ghostize()
if (!QDELETED(card) && loc != card)
card.forceMove(drop_location())
card.pai = null
card.emotion_icon = initial(card.emotion_icon)
card.update_appearance()
qdel(src)