Fixed an ahelp follow up bug. Works now

This commit is contained in:
joep van der velden
2019-03-09 22:20:19 +01:00
parent 8d6cee7915
commit 842615cd5b
10 changed files with 139 additions and 85 deletions
+38 -37
View File
@@ -103,44 +103,45 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
if(check_rights(R_MENTOR, 0, X.mob))
mentorholders += X
continue
var/ticketNum // Holder for the ticket number
var/prunedmsg ="[src]: [msg]" // Message without links
var/datum/ticket/T
var/isMhelp = selected_type == "Mentorhelp"
var/span
if(isMhelp)
span = "<span class='mentorhelp'>"
if(SSmentor_tickets.checkForOpenTicket(src)) // If user already has an open ticket
T = SSmentor_tickets.checkForOpenTicket(src)
else
ticketNum = SSmentor_tickets.getTicketCounter() // ticketNum is the ticket ready to be assigned.
else //Ahelp
span = "<span class='adminhelp'>"
if(SStickets.checkForOpenTicket(src)) // If user already has an open ticket
T = SStickets.checkForOpenTicket(src) // Make T equal to the ticket they have open
else
ticketNum = SStickets.getTicketCounter() // ticketNum is the ticket ready to be assigned.
if(T)
ticketNum = T.ticketNum // ticketNum is the number of their ticket.
T.addResponse(src, msg)
msg = "[span][selected_type]: </span><span class='boldnotice'>[key_name(src, TRUE, selected_type)] ([ADMIN_QUE(mob,"?")]) ([ADMIN_PP(mob,"PP")]) ([ADMIN_VV(mob,"VV")]) ([ADMIN_SM(mob,"SM")]) ([admin_jump_link(mob)]) (<A HREF='?_src_=holder;check_antagonist=1'>CA</A>) (<A HREF='?_src_=holder;[isMhelp ? "openmentorticket" : "openadminticket"]=[ticketNum]'>TICKET</A>) [ai_found ? "(<A HREF='?_src_=holder;adminchecklaws=[mob.UID()]'>CL</A>)" : ""] (<A HREF='?_src_=holder;take_question=[ticketNum][isMhelp ? ";is_mhelp=1" : ""]'>TAKE</A>) :</span> [span][msg]</span>"
if(isMhelp)
//Open a new adminticket and inform the user.
SSmentor_tickets.newTicket(src, prunedmsg, msg)
for(var/client/X in mentorholders + modholders + adminholders)
if(X.prefs.sound & SOUND_MENTORHELP)
X << 'sound/effects/adminhelp.ogg'
to_chat(X, msg)
else //Ahelp
//Open a new adminticket and inform the user.
SStickets.newTicket(src, prunedmsg, msg)
for(var/client/X in modholders + adminholders)
if(X.prefs.sound & SOUND_ADMINHELP)
X << 'sound/effects/adminhelp.ogg'
window_flash(X)
to_chat(X, msg)
switch(selected_type)
if("Mentorhelp")
var/ticketNum // Holder for the ticket number
var/prunedmsg ="[usr.client]: [msg]" // Message without links
if(SSmentor_tickets.checkForOpenTicket(usr)) // If user already has an open ticket
var/datum/ticket/T = SSmentor_tickets.checkForOpenTicket(usr) // Make T equal to the ticket they have open
ticketNum = T.ticketNum // ticketNum is the number of their ticket.
T.addResponse(usr.client, msg)
message_admins("open Mticket found num [ticketNum]")
else
ticketNum = SSmentor_tickets.getTicketCounter() // ticketNum is the ticket ready to be assigned.
msg = "<span class='mentorhelp'>[selected_type]: </span><span class='boldnotice'>[key_name(src, TRUE, selected_type)] ([ADMIN_QUE(mob,"?")]) ([ADMIN_PP(mob,"PP")]) ([ADMIN_VV(mob,"VV")]) ([ADMIN_SM(mob,"SM")]) ([admin_jump_link(mob)]) (<A HREF='?_src_=holder;check_antagonist=1'>CA</A>) (<A HREF='?_src_=holder;openmentorticket=[ticketNum]'>TICKET</A>) [ai_found ? " (<A HREF='?_src_=holder;adminchecklaws=[mob.UID()]'>CL</A>)" : ""] (<A HREF='?_src_=holder;take_question=[mob.UID()];is_mhelp=1'>TAKE</A>) :</span> <span class='mentorhelp'>[msg]</span>"
//Open a new adminticket and inform the user.
SSmentor_tickets.newTicket(src, prunedmsg, msg)
for(var/client/X in mentorholders + modholders + adminholders)
if(X.prefs.sound & SOUND_MENTORHELP)
X << 'sound/effects/adminhelp.ogg'
to_chat(X, msg)
if("Adminhelp")
var/ticketNum // Holder for the ticket number
var/prunedmsg ="[usr.client]: [msg]" // Message without links
if(SStickets.checkForOpenTicket(usr)) // If user already has an open ticket
message_admins("open ticket found")
var/datum/ticket/T = SStickets.checkForOpenTicket(usr) // Make T equal to the ticket they have open
ticketNum = T.ticketNum // ticketNum is the number of their ticket.
T.addResponse(usr.client, msg)
message_admins("open Aticket found num [ticketNum]")
else
ticketNum = SStickets.getTicketCounter() // ticketNum is the ticket ready to be assigned.
msg = "<span class='adminhelp'>[selected_type]: </span><span class='boldnotice'>[key_name(src, TRUE, selected_type)] ([ADMIN_QUE(mob,"?")]) ([ADMIN_PP(mob,"PP")]) ([ADMIN_VV(mob,"VV")]) ([ADMIN_SM(mob,"SM")]) ([admin_jump_link(mob)]) (<A HREF='?_src_=holder;check_antagonist=1'>CA</A>) (<A HREF='?_src_=holder;openadminticket=[ticketNum]'>TICKET</A>) [ai_found ? " (<A HREF='?_src_=holder;adminchecklaws=[mob.UID()]'>CL</A>)" : ""](<A HREF='?_src_=holder;take_question=[mob.UID()]'>TAKE</A>) :</span> <span class='adminhelp'>[msg]</span>"
//Open a new adminticket and inform the user.
SStickets.newTicket(src, prunedmsg, msg)
for(var/client/X in modholders + adminholders)
if(X.prefs.sound & SOUND_ADMINHELP)
X << 'sound/effects/adminhelp.ogg'
window_flash(X)
to_chat(X, msg)
//show it to the person adminhelping too
to_chat(src, "<span class='boldnotice'>[selected_type]</b>: [original_msg]</span>")
+16 -11
View File
@@ -182,23 +182,28 @@
else
if(check_rights(R_ADMIN|R_MOD, 0, X.mob))
to_chat(X, "<span class='boldnotice'>[type]: [key_name(src, TRUE, type)]-&gt;[key_name(C, TRUE, type)]: [emoji_msg]</span>")
if(type == "Mentorhelp")
return
//Check if the mob being PM'd has any open admin tickets.
var/tickets = list()
tickets = SStickets.checkForTicket(C)
if(type == "Mentorhelp")
tickets = SSmentor_tickets.checkForTicket(C)
else
tickets = SStickets.checkForTicket(C)
if(tickets)
for(var/datum/ticket/i in tickets)
i.addResponse(src, msg) // Add this response to their open tickets.
return
if(check_rights(R_ADMIN|R_MOD, 0, C.mob)) //Is the person being pm'd an admin? If so we check if the pm'er has open tickets
tickets = SStickets.checkForTicket(src)
if(tickets)
for(var/datum/ticket/i in tickets)
i.addResponse(src, msg)
return
if(type == "Mentorhelp")
if(check_rights(R_ADMIN|R_MOD|R_MENTOR, 0, C.mob)) //Is the person being pm'd an admin? If so we check if the pm'er has open tickets
tickets = SSmentor_tickets.checkForTicket(src)
else // Ahelp
if(check_rights(R_ADMIN|R_MOD, 0, C.mob)) //Is the person being pm'd an admin? If so we check if the pm'er has open tickets
tickets = SStickets.checkForTicket(src)
if(tickets)
for(var/datum/ticket/i in tickets)
i.addResponse(src, msg)
return
/client/proc/cmd_admin_irc_pm()