From dd667931b1b9db7cb2095f911812ed258e84e857 Mon Sep 17 00:00:00 2001 From: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com> Date: Wed, 12 Jan 2022 00:58:45 -0500 Subject: [PATCH] stealthed admins no longer count on the orbiting menu (#63940) Currently, you can tell if someone is being orbited by a stealthed admin by checking the orbit menu and seeing if there's an extra orbiter compared to what you see visually orbiting them. This makes it so stealthmins don't contribute to the orbiter count to avoid that. --- code/game/atoms.dm | 20 +++++++++--- code/modules/admin/admin_verbs.dm | 54 ++++++++++++++++--------------- 2 files changed, 43 insertions(+), 31 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 32be7a72e3f..7f5d9a8fcb0 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -2036,20 +2036,30 @@ * Recursive getter method to return a list of all ghosts orbitting this atom * * This will work fine without manually passing arguments. + * * processed - The list of atoms we've already convered + * * source - Is this the atom for who we're counting up all the orbiters? + * * ignored_stealthed_admins - If TRUE, don't count admins who are stealthmoded and orbiting this */ -/atom/proc/get_all_orbiters(list/processed, source = TRUE) +/atom/proc/get_all_orbiters(list/processed, source = TRUE, ignore_stealthed_admins = TRUE) var/list/output = list() - if (!processed) + if(!processed) processed = list() - if (src in processed) + else if(src in processed) return output - if (!source) + + if(!source) output += src + processed += src - for (var/atom/atom_orbiter as anything in orbiters?.orbiter_list) + for(var/atom/atom_orbiter as anything in orbiters?.orbiter_list) output += atom_orbiter.get_all_orbiters(processed, source = FALSE) return output +/mob/get_all_orbiters(list/processed, source = TRUE, ignore_stealthed_admins = TRUE) + if(!source && ignore_stealthed_admins && client?.holder?.fakekey) + return list() + return ..() + /** * Instantiates the AI controller of this atom. Override this if you want to assign variables first. * diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 5d4aac3c25b..e38165e29eb 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -457,33 +457,35 @@ GLOBAL_PROTECT(admin_verbs_hideable) /client/proc/stealth() set category = "Admin" set name = "Stealth Mode" - if(holder) - if(holder.fakekey) - holder.fakekey = null - if(isobserver(mob)) - mob.invisibility = initial(mob.invisibility) - mob.alpha = initial(mob.alpha) - if(mob.mind) - if(mob.mind.ghostname) - mob.name = mob.mind.ghostname - else - mob.name = mob.mind.name + if(!holder) + return + + if(holder.fakekey) + holder.fakekey = null + if(isobserver(mob)) + mob.invisibility = initial(mob.invisibility) + mob.alpha = initial(mob.alpha) + if(mob.mind) + if(mob.mind.ghostname) + mob.name = mob.mind.ghostname else - mob.name = mob.real_name - mob.mouse_opacity = initial(mob.mouse_opacity) - else - var/new_key = ckeyEx(stripped_input(usr, "Enter your desired display name.", "Fake Key", key, 26)) - if(!new_key) - return - holder.fakekey = new_key - createStealthKey() - if(isobserver(mob)) - mob.invisibility = INVISIBILITY_MAXIMUM //JUST IN CASE - mob.alpha = 0 //JUUUUST IN CASE - mob.name = " " - mob.mouse_opacity = MOUSE_OPACITY_TRANSPARENT - log_admin("[key_name(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]") - message_admins("[key_name_admin(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]") + mob.name = mob.mind.name + else + mob.name = mob.real_name + mob.mouse_opacity = initial(mob.mouse_opacity) + else + var/new_key = ckeyEx(stripped_input(usr, "Enter your desired display name.", "Fake Key", key, 26)) + if(!new_key) + return + holder.fakekey = new_key + createStealthKey() + if(isobserver(mob)) + mob.invisibility = INVISIBILITY_MAXIMUM //JUST IN CASE + mob.alpha = 0 //JUUUUST IN CASE + mob.name = " " + mob.mouse_opacity = MOUSE_OPACITY_TRANSPARENT + log_admin("[key_name(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]") + message_admins("[key_name_admin(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]") SSblackbox.record_feedback("tally", "admin_verb", 1, "Stealth Mode") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/drop_bomb()