diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index 9bb970cf53b..d76c7987b94 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -259,6 +259,9 @@ if(!M) continue + // Unregister the signal first, otherwise it'll trigger the "ling revived inside us" code + UnregisterSignal(M, COMSIG_MOB_STATCHANGE) + M.forceMove(T) if(M.revive(full_heal = TRUE, admin_revive = TRUE)) M.grab_ghost(force = TRUE) @@ -266,14 +269,27 @@ to_chat(M, "You leave [src]'s warm embrace, and feel ready to take on the world.") /mob/living/simple_animal/hostile/imp/slaughter/laughter/bloodcrawl_swallow(mob/living/victim) - if(consumed_mobs) - // Keep their corpse so rescue is possible - consumed_mobs += victim - else - // Be safe and just eject the corpse - victim.forceMove(get_turf(victim)) - victim.exit_blood_effect() - victim.visible_message("[victim] falls out of the air, covered in blood, looking highly confused. And dead.") + // Keep their corpse so rescue is possible + consumed_mobs += victim + RegisterSignal(victim, COMSIG_MOB_STATCHANGE, .proc/on_victim_statchange) + +/* Handle signal from a consumed mob changing stat. + * + * A signal handler for if one of the laughter demon's consumed mobs has + * changed stat. If they're no longer dead (because they were dead when + * swallowed), eject them so they can't rip their way out from the inside. + */ +/mob/living/simple_animal/hostile/imp/slaughter/laughter/proc/on_victim_statchange(mob/living/victim, new_stat) + SIGNAL_HANDLER + + if(new_stat == DEAD) + return + // Someone we've eaten has spontaneously revived; maybe nanites, maybe a changeling + victim.forceMove(get_turf(src)) + victim.exit_blood_effect() + victim.visible_message("[victim] falls out of the air, covered in blood, with a confused look on their face.") + consumed_mobs -= victim + UnregisterSignal(victim, COMSIG_MOB_STATCHANGE) /mob/living/simple_animal/hostile/imp/slaughter/engine_demon name = "engine demon"