[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>
This commit is contained in:
SkyratBot
2021-04-26 12:00:21 +01:00
committed by GitHub
co-authored by itseasytosee
parent b3f32ad8f0
commit 89fdfc85bd
+8
View File
@@ -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, "<span class='userwarning'>You were unable to finish your crystallization, for obvious reasons.</span>")
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)