diff --git a/code/modules/mob/living/basic/vermin/cockroach.dm b/code/modules/mob/living/basic/vermin/cockroach.dm index 10e703d63e7..32df5e915ec 100644 --- a/code/modules/mob/living/basic/vermin/cockroach.dm +++ b/code/modules/mob/living/basic/vermin/cockroach.dm @@ -44,7 +44,7 @@ /mob/living/basic/cockroach/death(gibbed) if(GLOB.station_was_nuked) //If the nuke is going off, then cockroaches are invincible. Keeps the nuke from killing them, cause cockroaches are immune to nukes. return - ..() + return ..() /mob/living/basic/cockroach/ex_act() //Explosions are a terrible way to handle a cockroach. return FALSE diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index d8e798b946f..9e338a66b8b 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -581,36 +581,28 @@ anchored = TRUE resistance_flags = FIRE_PROOF | ACID_PROOF | INDESTRUCTIBLE paint_jobs = null - var/mob/living/simple_animal/holder_animal - -/obj/structure/closet/stasis/process() - if(holder_animal) - if(holder_animal.stat == DEAD) - dump_contents() - holder_animal.investigate_log("has been gibbed by [src].", INVESTIGATE_DEATHS) - holder_animal.gib() - return + ///The animal the closet (and the user's body) is inside of + var/mob/living/holder_animal /obj/structure/closet/stasis/Initialize(mapload) . = ..() if(isanimal_or_basicmob(loc)) holder_animal = loc - START_PROCESSING(SSobj, src) + RegisterSignal(holder_animal, COMSIG_LIVING_DEATH, PROC_REF(on_holder_animal_death)) /obj/structure/closet/stasis/Entered(atom/movable/arrived, atom/old_loc, list/atom/old_locs) . = ..() if(isliving(arrived) && holder_animal) - var/mob/living/L = arrived - L.notransform = 1 - ADD_TRAIT(L, TRAIT_MUTE, STASIS_MUTE) - L.status_flags |= GODMODE - L.mind.transfer_to(holder_animal) + var/mob/living/possessor = arrived + possessor.notransform = TRUE + ADD_TRAIT(possessor, TRAIT_MUTE, STASIS_MUTE) + possessor.status_flags |= GODMODE + possessor.mind.transfer_to(holder_animal) var/datum/action/exit_possession/escape = new(holder_animal) escape.Grant(holder_animal) remove_verb(holder_animal, /mob/living/verb/pulled) /obj/structure/closet/stasis/dump_contents(kill = TRUE) - STOP_PROCESSING(SSobj, src) for(var/mob/living/possessor in src) REMOVE_TRAIT(possessor, TRAIT_MUTE, STASIS_MUTE) possessor.status_flags &= ~GODMODE @@ -622,6 +614,7 @@ possessor.forceMove(get_turf(holder_animal)) holder_animal.mind.transfer_to(possessor) possessor.mind.grab_ghost(force = TRUE) + holder_animal.investigate_log("has been gibbed by [src].", INVESTIGATE_DEATHS) holder_animal.gib() return ..() return ..() @@ -632,6 +625,11 @@ /obj/structure/closet/stasis/ex_act() return FALSE +///When our host animal dies in any way, we empty the stasis closet out. +/obj/structure/closet/stasis/proc/on_holder_animal_death() + SIGNAL_HANDLER + dump_contents() + /datum/action/exit_possession name = "Exit Possession" desc = "Exits the body you are possessing. They will explode violently when this occurs."