diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm index b386c04eb96..df5c83f9b8c 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -2,4 +2,10 @@ ..() if(client.prefs.unlock_content) icon_state = client.prefs.ghost_form + if (ghostimage) + ghostimage.icon_state = src.icon_state + + updateghostimages() + + update_interface() \ No newline at end of file diff --git a/code/modules/mob/dead/observer/logout.dm b/code/modules/mob/dead/observer/logout.dm index 11c6c3c834c..22c272a654e 100644 --- a/code/modules/mob/dead/observer/logout.dm +++ b/code/modules/mob/dead/observer/logout.dm @@ -1,4 +1,5 @@ /mob/dead/observer/Logout() + client.images -= ghostimages ..() spawn(0) if(src && !key) //we've transferred to another mob. This ghost should be deleted. diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index d8e22b4af0b..8447dd231bf 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1,3 +1,4 @@ +var/list/image/ghostimages = list() //this is a list of images of other ghosts that ghosts see when they toggle darkness /mob/dead/observer name = "ghost" desc = "It's a g-g-g-g-ghooooost!" //jinkies! @@ -18,6 +19,7 @@ //Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot. var/atom/movable/following = null var/fun_verbs = 0 + var/image/ghostimage = null /mob/dead/observer/New(mob/body) sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF @@ -26,6 +28,9 @@ verbs += /mob/dead/observer/proc/dead_tele stat = DEAD + ghostimage = image(src.icon,src,src.icon_state) + ghostimages |= ghostimage + var/turf/T if(ismob(body)) T = get_turf(body) //Where is the body located? @@ -54,8 +59,14 @@ verbs -= /mob/dead/observer/verb/possess animate(src, pixel_y = 2, time = 10, loop = -1) + updateallghostimages() ..() +/mob/dead/observer/Destroy() + ghostimages -= ghostimage + qdel(ghostimage) + updateallghostimages() + ..() /mob/dead/CanPass(atom/movable/mover, turf/target, height=0) return 1 @@ -262,6 +273,20 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp see_invisible = SEE_INVISIBLE_OBSERVER else see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING + updateghostimages() + +/mob/dead/observer/proc/updateallghostimages() + for (var/mob/dead/observer/O in player_list) + O.updateghostimages() + +/mob/dead/observer/proc/updateghostimages() + if (!client) + return + if (see_invisible >= SEE_INVISIBLE_OBSERVER) + client.images -= ghostimages + else + client.images |= ghostimages //add images for all the ghosts so we can see them + client.images -= ghostimage //remove ourself /mob/dead/observer/verb/possess() set category = "Ghost"