[MIRROR] Catches an edge case in ahelp replies [MDB IGNORE] (#15454)

* Catches an edge case in ahelp replies (#69053)

It turns out if you hit reply to an ahelp before it was closed, and then
sent back the input() after close, you'd end up with a runtime leaking
your reply, and no feedback.

This catches that case, and instead forwards it to a new ahelp, so the
text isn't lost, and the closed ticket is respected

Approved by sitting headcatmin Timberpose

🆑
fix: Attempting to send back a reply to an ahelp after it is closed now sends the reply to a new ticket, rather then just dropping it and leaving you for dead with a runtime
admin: see above
/🆑

* Catches an edge case in ahelp replies

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-08-07 17:43:42 +02:00
committed by GitHub
parent d4afbaf7d1
commit 2a1c0668b6
+14
View File
@@ -450,6 +450,20 @@
// Ok by this point the recipient has to be an admin, and this is either an admin on admin event, or a player replying to an admin
// You're replying to a ticket that is closed. Bad move. You must have started replying before the close, and then got input()'d
// Lets be nice and pass this off to a new ticket, as we recomend above
if(!ticket)
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = span_danger("Error: Admin-PM-Send: Attempted to send a reply to a closed ticket."),
confidential = TRUE)
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = span_notice("Relaying message to a new admin help."),
confidential = TRUE)
GLOB.admin_help_ui_handler.perform_adminhelp(src, raw_message, FALSE)
return FALSE
// Let's play some music for the admin, only if they want it tho
if(sound_prefs & SOUND_ADMINHELP)
SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg'))