From 89fdfc85bd8bc173564229a40dd538eecd13e23a Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 26 Apr 2021 13:00:21 +0200 Subject: [PATCH] [MIRROR] Stops ethereal from crystalizing while eaten (#5210) * Stops ethereal from crystalizing while eaten (#58650) Checks if an ethereal is in an item or mob before making the crystal. Stops weird cases where one might just appear outside a space dragon or create legions that dropped no corpses. fixes #58643 Look if someone wants to code the process of an ethereal coming back to life in a space dragon's stomach I won't stop you but I will judge you. * Stops ethereal from crystalizing while eaten Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com> --- code/modules/surgery/organs/heart.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 571f9fea7c8..8f56a3c3074 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -356,8 +356,16 @@ ///Actually spawns the crystal which puts the ethereal in it. /obj/item/organ/heart/ethereal/proc/crystalize(mob/living/ethereal) + + var/location = ethereal.loc + if(!COOLDOWN_FINISHED(src, crystalize_cooldown) || ethereal.stat != DEAD) return //Should probably not happen, but lets be safe. + + if(ismob(location) || isitem(location)) //Stops crystallization if they are eaten by a dragon, turned into a legion, consumed by his grace, etc. + to_chat(ethereal, "You were unable to finish your crystallization, for obvious reasons.") + stop_crystalization_process(ethereal, FALSE) + return COOLDOWN_START(src, crystalize_cooldown, INFINITY) //Prevent cheeky double-healing until we get out, this is against stupid admemery current_crystal = new(get_turf(ethereal), src) stop_crystalization_process(ethereal, TRUE)