diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 658ba9cad40..b457da774ce 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -2058,20 +2058,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 331b1949a53..a68a0149f3d 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -477,33 +477,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()