diff --git a/code/__DEFINES/client.dm b/code/__DEFINES/client.dm index fc70fa9dbca..0008a736acd 100644 --- a/code/__DEFINES/client.dm +++ b/code/__DEFINES/client.dm @@ -10,3 +10,6 @@ /// The maximum client BYOND build to disable screentip icons for. /// Update this whenever https://www.byond.com/forum/post/2967731 is fixed. #define MAX_BYOND_BUILD_DISABLE_SCREENTIP_ICONS 1699 + +/// Aghosting AND APPERANTLY STEALTHMINNING sets your ckey/key == "@[old_key]" because it hates me. this detects that +#define IS_FAKE_KEY(key) (key && key[1] == "@") diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 5d2598fc0f7..eb1733b1ae5 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -735,7 +735,7 @@ ADMIN_VERB(cmd_admin_pm_panel, R_NONE, "Admin PM", "Show a list of clients to PM return null var/searching_ckey = whom - if(whom[1] == "@") + if(IS_FAKE_KEY(whom)) searching_ckey = findTrueKey(whom) if(searching_ckey == EXTERNAL_PM_USER) diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 0218035616b..94e866c27b6 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -259,7 +259,7 @@ Works together with spawning an observer, noted above. /mob/proc/ghostize(can_reenter_corpse = TRUE, admin_ghost = FALSE) if(!key) return - if(key[1] == "@") // Skip aghosts. + if(IS_FAKE_KEY(key)) // Skip aghosts. return if(HAS_TRAIT(src, TRAIT_CORPSELOCKED) && !admin_ghost) @@ -370,7 +370,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(!can_reenter_corpse) to_chat(src, span_warning("You cannot re-enter your body.")) return - if(mind.current.key && mind.current.key[1] != "@") //makes sure we don't accidentally kick any clients + if(mind.current.key && !IS_FAKE_KEY(mind.current.key)) //makes sure we don't accidentally kick any clients to_chat(usr, span_warning("Another consciousness is in your body...It is resisting you.")) return client.view_size.setDefault(getScreenSize(client.prefs.read_preference(/datum/preference/toggle/widescreen)))//Let's reset so people can't become allseeing gods diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 5d9c09adb19..1deb75b5638 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -885,7 +885,7 @@ if (current_brain.suicided || (current_brain.brainmob && HAS_TRAIT(current_brain.brainmob, TRAIT_SUICIDED))) return DEFIB_FAIL_NO_INTELLIGENCE - if(key && key[1] == "@") // Adminghosts + if(IS_FAKE_KEY(key)) return DEFIB_NOGRAB_AGHOST return DEFIB_POSSIBLE diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index a49da495e30..db7ae4535d1 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -26,7 +26,7 @@ /mob/Destroy() if(client) stack_trace("Mob with client has been deleted.") - else if(ckey) + else if(ckey && !IS_FAKE_KEY(ckey)) // FUCK YOU AGHOST CODE FUCK YOU stack_trace("Mob without client but with associated ckey, [ckey], has been deleted.") persistent_client?.set_mob(null) diff --git a/code/modules/spells/spell_types/pointed/mind_transfer.dm b/code/modules/spells/spell_types/pointed/mind_transfer.dm index bb632140c9e..ddf87d3008c 100644 --- a/code/modules/spells/spell_types/pointed/mind_transfer.dm +++ b/code/modules/spells/spell_types/pointed/mind_transfer.dm @@ -112,7 +112,7 @@ || mind_to_swap.has_antag_datum(/datum/antagonist/cult) \ || mind_to_swap.has_antag_datum(/datum/antagonist/changeling) \ || mind_to_swap.has_antag_datum(/datum/antagonist/rev) \ - || mind_to_swap.key?[1] == "@" \ + || IS_FAKE_KEY(mind_to_swap.key) \ ) to_chat(caster, span_warning("[to_swap.p_Their()] mind is resisting your spell!")) return FALSE