diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm index 3a6d55ca7d..88b513e06e 100644 --- a/code/game/objects/items/bodybag.dm +++ b/code/game/objects/items/bodybag.dm @@ -86,6 +86,17 @@ qdel(src) return +/obj/structure/closet/body_bag/proc/get_occupants() + var/list/occupants = list() + for(var/mob/living/carbon/human/H in contents) + occupants += H + return occupants + +/obj/structure/closet/body_bag/proc/update(var/broadcast=0) + if(istype(loc, /obj/structure/morgue)) + var/obj/structure/morgue/M = loc + M.update(broadcast) + /obj/structure/closet/body_bag/update_icon() if(opened) icon_state = icon_opened diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 949cbc1ff6..bd28078782 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -18,6 +18,7 @@ dir = EAST density = 1 var/obj/structure/m_tray/connected = null + var/list/occupants = list() anchored = 1.0 /obj/structure/morgue/Destroy() @@ -26,12 +27,28 @@ connected = null return ..() -/obj/structure/morgue/proc/update() +/obj/structure/morgue/proc/get_occupants() + occupants.Cut() + for(var/mob/living/carbon/human/H in contents) + occupants += H + for(var/obj/structure/closet/body_bag/B in contents) + occupants += B.get_occupants() + +/obj/structure/morgue/proc/update(var/broadcast=0) if (src.connected) src.icon_state = "morgue0" else if (src.contents.len) src.icon_state = "morgue2" + get_occupants() + for (var/mob/living/carbon/human/H in occupants) + if(H.isSynthetic() || H.suiciding || !H.ckey || !H.client || (NOCLONE in H.mutations) || (H.species && H.species.flags & NO_SCAN)) + src.icon_state = "morgue2" + break + else + src.icon_state = "morgue3" + if(broadcast) + broadcast_medical_hud_message("[src] was able to establish a mental interface with occupant.", src) else src.icon_state = "morgue1" return diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 68c631101d..a718e8be41 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -155,6 +155,12 @@ Works together with spawning an observer, noted above. ghost.can_reenter_corpse = can_reenter_corpse ghost.timeofdeath = src.timeofdeath //BS12 EDIT ghost.key = key + if(istype(loc, /obj/structure/morgue)) + var/obj/structure/morgue/M = loc + M.update() + else if(istype(loc, /obj/structure/closet/body_bag)) + var/obj/structure/closet/body_bag/B = loc + B.update() if(ghost.client) ghost.client.time_died_as_mouse = ghost.timeofdeath if(ghost.client && !ghost.client.holder && !config.antag_hud_allowed) // For new ghosts we remove the verb from even showing up if it's not allowed. @@ -224,6 +230,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp mind.current.ajourn=0 mind.current.key = key mind.current.teleop = null + if(istype(mind.current.loc, /obj/structure/morgue)) + var/obj/structure/morgue/M = mind.current.loc + M.update(1) + else if(istype(mind.current.loc, /obj/structure/closet/body_bag)) + var/obj/structure/closet/body_bag/B = mind.current.loc + B.update(1) if(!admin_ghosted) announce_ghost_joinleave(mind, 0, "They now occupy their body again.") return 1 diff --git a/icons/obj/stationobjs.dmi b/icons/obj/stationobjs.dmi index 225705ab65..94f46b9c2c 100644 Binary files a/icons/obj/stationobjs.dmi and b/icons/obj/stationobjs.dmi differ