[MIRROR] @Runa-Dacino add(mentorhelp): Makes mhelps check for active mentors a… (#7929)

Co-authored-by: Casey <a.roaming.shadow@gmail.com>
Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
Co-authored-by: Raeschen <rycoop29@gmail.com>
This commit is contained in:
CHOMPStation2
2024-03-12 06:13:28 -07:00
committed by GitHub
parent b82befcae2
commit 5824cc80d4

View File

@@ -429,6 +429,25 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new)
if(!msg)
return
// Making sure there's actually a mentor or admin who can respond.
var/list/admins = get_admin_counts()
var/list/activeAdmins = admins["present"]
var/list/mentors = GLOB.mentors
if(!mentors.len && !activeAdmins.len)
var/choice = tgui_alert(usr, "There are no active admins or mentors online. Would you like to make an ahelp instead, so that staff is notified of your issue? \
Alternatively, you may go to the discord yourself and repeat your question in #ss13-tutoring. Please note, if choosing the later, do not include current-round information.",
"Send to discord?", list("Admin-help!", "Still mentorhelp!", "Cancel"))
if(choice == "Admin-help!")
usr.client.adminhelp(msg)
src.verbs -= /client/verb/mentorhelp
spawn(1200)
src.verbs += /client/verb/mentorhelp // 2 minute cd to prevent abusing this to spam admins.
return
else if(choice == "Cancel")
return
//remove out adminhelp verb temporarily to prevent spamming of admins.
src.verbs -= /client/verb/mentorhelp
spawn(600)