From 93c9fb4cd3f15ff4e2987d32efde0b01c1c1e7ec Mon Sep 17 00:00:00 2001 From: ShizCalev Date: Sun, 24 Mar 2019 01:50:50 -0400 Subject: [PATCH] Fix admin follow runtime (#43282) Fixed a minor runtime caused by admins clicking a follow link while in the lobby. --- code/modules/admin/admin_verbs.dm | 4 +++- code/modules/admin/topic.dm | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 013ae1f7a93..a53fefc03c6 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -333,11 +333,12 @@ GLOBAL_PROTECT(admin_verbs_hideable) set name = "Aghost" if(!holder) return + . = TRUE if(isobserver(mob)) //re-enter var/mob/dead/observer/ghost = mob if(!ghost.mind || !ghost.mind.current) //won't do anything if there is no body - return + return FALSE if(!ghost.can_reenter_corpse) log_admin("[key_name(usr)] re-entered corpse") message_admins("[key_name_admin(usr)] re-entered corpse") @@ -346,6 +347,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) SSblackbox.record_feedback("tally", "admin_verb", 1, "Admin Reenter") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! else if(isnewplayer(mob)) to_chat(src, "Error: Aghost: Can't admin-ghost whilst in the lobby. Join or Observe first.") + return FALSE else //ghostize log_admin("[key_name(usr)] admin ghosted.") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index e7071714004..feec340e764 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -930,8 +930,12 @@ var/atom/movable/AM = locate(href_list["adminplayerobservefollow"]) var/client/C = usr.client + var/can_ghost = TRUE if(!isobserver(usr)) - C.admin_ghost() + can_ghost = C.admin_ghost() + + if(!can_ghost) + return var/mob/dead/observer/A = C.mob A.ManualFollow(AM)