diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 95fc060fc0c..2ec216fac1e 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -87,7 +87,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) real_name = name //starts ghosts off with all HUDs. - toggle_all_huds_on() + toggle_all_huds_on(body) ..() /mob/dead/observer/Destroy() @@ -323,10 +323,23 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp return GLOB.ghost_hud_panel.ui_interact(src) -/mob/dead/observer/proc/toggle_all_huds_on() +/** + * Toggles on all HUDs for the ghost player. + * + * Enables antag HUD only if the ghost belongs to an admin. + * + * Arguments: + * * user - A reference to the ghost's old mob. This argument is required since `src` does not have a `client` at this point. + */ +/mob/dead/observer/proc/toggle_all_huds_on(mob/user) show_me_the_hud(DATA_HUD_DIAGNOSTIC) show_me_the_hud(DATA_HUD_SECURITY_ADVANCED) show_me_the_hud(DATA_HUD_MEDICAL_ADVANCED) + if(!check_rights((R_ADMIN | R_MOD), FALSE, user)) + return + antagHUD = TRUE + for(var/datum/atom_hud/antag/H in GLOB.huds) + H.add_hud_to(src) /mob/dead/observer/verb/set_dnr() set name = "Set DNR" diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 30a26a7af6e..ec54e6aa9c4 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -172,7 +172,7 @@ if(alert(src,"Are you sure you wish to observe? You cannot normally join the round after doing this!","Player Setup","Yes","No") == "Yes") if(!client) return 1 - var/mob/dead/observer/observer = new() + var/mob/dead/observer/observer = new(src) src << browse(null, "window=playersetup") spawning = 1 stop_sound_channel(CHANNEL_LOBBYMUSIC)