Mob ckey sanity check now respects insano aghost code (#91517)

## About The Pull Request

I HATE THIS PLACE DUDE, aghosting sets your ckey/key to your normal
ckey/ckey but with @ prefixed. hhhhhhhhh.
This commit is contained in:
LemonInTheDark
2025-06-08 14:09:54 -07:00
committed by Roxy
parent 6b3432753c
commit d5be02ecee
6 changed files with 9 additions and 6 deletions

View File

@@ -10,3 +10,6 @@
/// The maximum client BYOND build to disable screentip icons for. /// The maximum client BYOND build to disable screentip icons for.
/// Update this whenever https://www.byond.com/forum/post/2967731 is fixed. /// Update this whenever https://www.byond.com/forum/post/2967731 is fixed.
#define MAX_BYOND_BUILD_DISABLE_SCREENTIP_ICONS 1699 #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] == "@")

View File

@@ -741,7 +741,7 @@ ADMIN_VERB(cmd_admin_pm_panel, R_NONE, "Admin PM", "Show a list of clients to PM
return null return null
var/searching_ckey = whom var/searching_ckey = whom
if(whom[1] == "@") if(IS_FAKE_KEY(whom))
searching_ckey = findTrueKey(whom) searching_ckey = findTrueKey(whom)
if(searching_ckey == EXTERNAL_PM_USER) if(searching_ckey == EXTERNAL_PM_USER)

View File

@@ -259,7 +259,7 @@ Works together with spawning an observer, noted above.
/mob/proc/ghostize(can_reenter_corpse = TRUE, admin_ghost = FALSE) /mob/proc/ghostize(can_reenter_corpse = TRUE, admin_ghost = FALSE)
if(!key) if(!key)
return return
if(key[1] == "@") // Skip aghosts. if(IS_FAKE_KEY(key)) // Skip aghosts.
return return
if(HAS_TRAIT(src, TRAIT_CORPSELOCKED) && !admin_ghost) if(HAS_TRAIT(src, TRAIT_CORPSELOCKED) && !admin_ghost)
@@ -375,7 +375,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(!can_reenter_corpse && !mind.has_antag_datum(/datum/antagonist/changeling)) //SKYRAT EDIT if(!can_reenter_corpse && !mind.has_antag_datum(/datum/antagonist/changeling)) //SKYRAT EDIT
to_chat(src, span_warning("You cannot re-enter your body.")) to_chat(src, span_warning("You cannot re-enter your body."))
return 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.")) to_chat(usr, span_warning("Another consciousness is in your body...It is resisting you."))
return return
client.view_size.setDefault(getScreenSize(client.prefs.read_preference(/datum/preference/toggle/widescreen)))//Let's reset so people can't become allseeing gods client.view_size.setDefault(getScreenSize(client.prefs.read_preference(/datum/preference/toggle/widescreen)))//Let's reset so people can't become allseeing gods

View File

@@ -898,7 +898,7 @@
if (current_brain.suicided || (current_brain.brainmob && HAS_TRAIT(current_brain.brainmob, TRAIT_SUICIDED))) if (current_brain.suicided || (current_brain.brainmob && HAS_TRAIT(current_brain.brainmob, TRAIT_SUICIDED)))
return DEFIB_FAIL_NO_INTELLIGENCE return DEFIB_FAIL_NO_INTELLIGENCE
if(key && key[1] == "@") // Adminghosts if(IS_FAKE_KEY(key))
return DEFIB_NOGRAB_AGHOST return DEFIB_NOGRAB_AGHOST
return DEFIB_POSSIBLE return DEFIB_POSSIBLE

View File

@@ -26,7 +26,7 @@
/mob/Destroy() /mob/Destroy()
if(client) if(client)
stack_trace("Mob with client has been deleted.") 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.") stack_trace("Mob without client but with associated ckey, [ckey], has been deleted.")
persistent_client?.set_mob(null) persistent_client?.set_mob(null)

View File

@@ -112,7 +112,7 @@
|| mind_to_swap.has_antag_datum(/datum/antagonist/cult) \ || 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/changeling) \
|| mind_to_swap.has_antag_datum(/datum/antagonist/rev) \ || 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!")) to_chat(caster, span_warning("[to_swap.p_Their()] mind is resisting your spell!"))
return FALSE return FALSE