diff --git a/code/datums/mind.dm b/code/datums/mind.dm index a3d9dbd8442..2e88f141f4a 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1516,6 +1516,19 @@ spell.action.Grant(new_character) return +/datum/mind/proc/get_ghost(even_if_they_cant_reenter) + for(var/mob/dead/observer/G in dead_mob_list) + if(G.mind == src) + if(G.can_reenter_corpse || even_if_they_cant_reenter) + return G + break + +/datum/mind/proc/grab_ghost(force) + var/mob/dead/observer/G = get_ghost(even_if_they_cant_reenter = force) + . = G + if(G) + G.reenter_corpse() + //Initialisation procs /mob/proc/mind_initialize() if(mind) diff --git a/code/game/gamemodes/miniantags/slaughter/slaughter.dm b/code/game/gamemodes/miniantags/slaughter/slaughter.dm index 11a979ed3b0..ac32105229a 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughter.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughter.dm @@ -207,13 +207,10 @@ /mob/living/simple_animal/slaughter/laughter/death() for(var/mob/living/M in consumed_mobs) - M.revive() - if(!M.ckey) - for(var/mob/dead/observer/ghost in player_list) - if(M.real_name == ghost.real_name) - ghost.reenter_corpse() - break - to_chat(M, "You leave the [src]'s warm embrace, and feel ready to take on the world.") + if(M.revive()) + M.grab_ghost(force = TRUE) + playsound(get_turf(src), feast_sound, 50, 1, -1) + to_chat(M, "You leave the [src]'s warm embrace, and feel ready to take on the world.") ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index f41cef386aa..7bce0e0e0cf 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1328,11 +1328,11 @@ mob/proc/yank_out_object() /mob/proc/get_ghost(even_if_they_cant_reenter = 0) if(mind) - for(var/mob/dead/observer/G in dead_mob_list) - if(G.mind == mind) - if(G.can_reenter_corpse || even_if_they_cant_reenter) - return G - break + return mind.get_ghost(even_if_they_cant_reenter) + +/mob/proc/grab_ghost(force) + if(mind) + return mind.grab_ghost(force = force) /mob/proc/notify_ghost_cloning(var/message = "Someone is trying to revive you. Re-enter your corpse if you want to be revived!", var/sound = 'sound/effects/genetics.ogg', var/atom/source = null) var/mob/dead/observer/ghost = get_ghost()