From 65f39fde2dd65271d986df4e89cab3905aeeb11f Mon Sep 17 00:00:00 2001 From: harryob Date: Fri, 1 Mar 2024 20:15:30 +0000 Subject: [PATCH 1/3] ahelp touchups --- code/modules/admin/verbs/adminhelp.dm | 10 +++++----- code/modules/admin/verbs/adminpm.dm | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 4b52f03c1ec8..bb80d6c49a6d 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -470,7 +470,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) if(state != AHELP_ACTIVE) return - if(marked_admin != usr.key) + if(marked_admin != usr.ckey) to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!")) return @@ -489,7 +489,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) if(state != AHELP_ACTIVE) return - if(marked_admin != usr.key) + if(marked_admin != usr.ckey) to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!")) return @@ -511,7 +511,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) if(state != AHELP_ACTIVE || !initial_message) return - if(marked_admin != usr.key) + if(marked_admin != usr.ckey) to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!")) return @@ -539,7 +539,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) /datum/admin_help/proc/mark_ticket() if(marked_admin) - if(marked_admin == usr.key) + if(marked_admin == usr.ckey) unmark_ticket() return to_chat(usr, SPAN_WARNING("This ticket has already been marked by [marked_admin].")) @@ -557,7 +557,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) message_admins(msg) log_admin_private(msg) log_ahelp(id, "Marked", "Marked by [usr.key]", sender = usr.ckey) - marked_admin = usr.key + marked_admin = usr.ckey /datum/admin_help/proc/unmark_ticket() var/key_name = key_name_admin(usr) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index a9a3a90ff35a..fe3cf36e9a9e 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -228,7 +228,8 @@ if(CLIENT_IS_STAFF(src)) //sender is an admin but recipient is not. Do BIG RED TEXT var/already_logged = FALSE if(!recipient.current_ticket) - new /datum/admin_help(msg, recipient, TRUE) + var/datum/admin_help/new_ticket = new(msg, recipient, TRUE) + new_ticket.marked_admin = ckey already_logged = TRUE log_ahelp(recipient.current_ticket.id, "Ticket Opened", msg, recipient.ckey, src.ckey) From 62df30e609cf460ef442bc08c7a627e2ef67681b Mon Sep 17 00:00:00 2001 From: harryob Date: Fri, 1 Mar 2024 20:18:14 +0000 Subject: [PATCH 2/3] unused variables --- code/modules/mob/mob_defines.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 0dc2a27594a7..44286b5fabe0 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -16,9 +16,6 @@ var/atom/movable/screen/hands = null //robot - var/adminhelp_marked = 0 // Prevents marking an Adminhelp more than once. Making this a client define will cause runtimes and break some Adminhelps - var/adminhelp_marked_admin = "" // Ckey of last marking admin - /// a ckey that persists client logout / ghosting, replaced when a client inhabits the mob var/persistent_ckey From 20a90bbb7bc7baf6a9d31324f808b72607d6ce89 Mon Sep 17 00:00:00 2001 From: harryob <55142896+harryob@users.noreply.github.com> Date: Sat, 2 Mar 2024 12:18:17 +0000 Subject: [PATCH 3/3] nullcheck --- code/modules/admin/verbs/adminhelp.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index bb80d6c49a6d..e464276e224e 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -470,7 +470,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) if(state != AHELP_ACTIVE) return - if(marked_admin != usr.ckey) + if(marked_admin && marked_admin != usr.ckey) to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!")) return @@ -489,7 +489,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) if(state != AHELP_ACTIVE) return - if(marked_admin != usr.ckey) + if(marked_admin && marked_admin != usr.ckey) to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!")) return @@ -511,7 +511,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) if(state != AHELP_ACTIVE || !initial_message) return - if(marked_admin != usr.ckey) + if(marked_admin && marked_admin != usr.ckey) to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!")) return