diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index d574d22f859..b3f49418ae8 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -32,8 +32,18 @@ if(M==null) M = locate() in B if(M) + var/ghost_can_reenter_corpse = null + if (M.mind) + for(var/mob/dead/observer/G in player_list) //Does the corpse have a ghost? + if (G.mind == M.mind) + if (G.client && G.can_reenter_corpse) + ghost_can_reenter_corpse = 1 + break + if(M.client) src.icon_state = "morgue3" + else if(M.mind && ghost_can_reenter_corpse) //There is a ghost and it is connected to the server + src.icon_state = "morgue5" else src.icon_state = "morgue2" @@ -110,8 +120,10 @@ t = copytext(sanitize(t),1,MAX_MESSAGE_LEN) if (t) src.name = text("Morgue- '[]'", t) + src.overlays += image(src.icon, "morgue_label") else src.name = "Morgue" + src.overlays.Cut() src.add_fingerprint(user) return diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 738e887b775..37a8a72d064 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -57,4 +57,25 @@ 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.can_reenter_corpse && G.mind.current) + C = G.mind.current + else if (istype(src,/mob/living/carbon/human)) //Aliens can't be cloned + C = src + + if (C) //We found our corpse, is it inside a morgue? + if (istype(C.loc,/obj/structure/morgue)) + Morgue = C.loc + else if (istype(C.loc,/obj/structure/closet/body_bag)) + var/obj/structure/closet/body_bag/B = C.loc + if (istype(B.loc,/obj/structure/morgue)) + Morgue = B.loc + if (Morgue) + Morgue.update() + diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index bb01c846caf..34071461d59 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -10,5 +10,26 @@ 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.can_reenter_corpse && G.mind.current) + C = G.mind.current + else if (istype(src,/mob/living/carbon/human)) //Aliens can't be cloned + C = src + + if (C) //We found our corpse, is it inside a morgue? + if (istype(C.loc,/obj/structure/morgue)) + Morgue = C.loc + else if (istype(C.loc,/obj/structure/closet/body_bag)) + var/obj/structure/closet/body_bag/B = C.loc + if (istype(B.loc,/obj/structure/morgue)) + Morgue = B.loc + if (Morgue) + Morgue.update() return 1 \ No newline at end of file diff --git a/icons/obj/stationobjs.dmi b/icons/obj/stationobjs.dmi index 2116eee6399..df78aea575d 100755 Binary files a/icons/obj/stationobjs.dmi and b/icons/obj/stationobjs.dmi differ