From 72ef4f38d542c8624f315aa4c043406a5f39cc5e Mon Sep 17 00:00:00 2001 From: DZD Date: Tue, 10 Feb 2015 11:25:07 -0500 Subject: [PATCH] Fixes Runtimes Fixes runtimes with Assume Direct Control from View Vars, and observing from the main menu. Morgue sprite code is the cause of both runtimes, and this may break morgue tray sprites. --- code/modules/mob/login.dm | 8 +++++--- code/modules/mob/logout.dm | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 27127a83e4e..39a1fb53631 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -57,18 +57,20 @@ client.verbs |= H.species.abilities CallHook("Login", list("client" = src.client, "mob" = src)) - + //Update morgues on login/logout if (stat == DEAD) var/obj/structure/morgue/Morgue = null var/mob/living/carbon/human/C = null if (istype(src,/mob/dead/observer)) //We're a ghost, let's find our corpse var/mob/dead/observer/G = src + if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control. + return if (G.can_reenter_corpse && G.mind.current) C = G.mind.current else if (istype(src,/mob/living/carbon/human)) C = src - + if (C) //We found our corpse, is it inside a morgue? if (istype(C.loc,/obj/structure/morgue)) Morgue = C.loc @@ -78,4 +80,4 @@ Morgue = B.loc if (Morgue) Morgue.update() - + diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index 45449c1e1c7..36df2619e38 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -10,18 +10,20 @@ if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell. send2adminirc("[key_name(src)] logged out - no more admins online.") ..() - + //Update morgues on login/logout if (stat == DEAD) var/obj/structure/morgue/Morgue = null var/mob/living/carbon/human/C = null if (istype(src,/mob/dead/observer)) //We're a ghost, let's find our corpse var/mob/dead/observer/G = src + if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control. + return 1 if (G.can_reenter_corpse && G.mind.current) C = G.mind.current else if (istype(src,/mob/living/carbon/human)) C = src - + if (C) //We found our corpse, is it inside a morgue? if (istype(C.loc,/obj/structure/morgue)) Morgue = C.loc