Skip to content

Commit

Permalink
Fixes the mentorwho verb (#22650)
Browse files Browse the repository at this point in the history
* clean and fix

* fixes

* Update topic.dm

* Update admin_verbs.dm
  • Loading branch information
Moltijoe authored Oct 28, 2024
1 parent bf9f643 commit de78fe0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 83 deletions.
2 changes: 1 addition & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ GLOBAL_PROTECT(admin_verbs_hideable)
to_chat(src, span_interface("You are now a normal player."), confidential=TRUE)

remove_mentor_verbs()
mentor_datum = null
QDEL_NULL(mentor_datum)
GLOB.mentors -= src
add_verb(src, /client/proc/rementor)

Expand Down
2 changes: 1 addition & 1 deletion yogstation/code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
return

C.remove_mentor_verbs()
C.mentor_datum = null
QDEL_NULL(C.mentor_datum)
GLOB.mentors -= C

if(SSdbcore.Connect())
Expand Down
2 changes: 1 addition & 1 deletion yogstation/code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
new /datum/mentors(ckey)

if(mentor_datum)
if(admin)
if(!admin)
GLOB.mentors |= src // don't add admins to this list too.

mentor_datum.owner = src
Expand Down
59 changes: 0 additions & 59 deletions yogstation/code/modules/client/verbs/who.dm

This file was deleted.

36 changes: 15 additions & 21 deletions yogstation/code/modules/mentor/mentor_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ GLOBAL_PROTECT(mentor_verbs)
set category = "Mentor"
var/position = "Mentor"
var/msg = "<b>Current Mentors & Wiki:</b>\n"
if(holder)
for(var/client/C in GLOB.mentors)
if(C.holder) continue
if(C.mentor_datum.position)
position = C.mentor_datum.position
msg += "\t[C] is a [position]"

if(C.holder && C.holder.fakekey)

for(var/client/C in GLOB.mentors)
if(C.holder)
continue
if(C.mentor_datum.position)
position = C.mentor_datum.position
msg += "\t[C] is a [position]"

if(holder) //admins get extra info about the mentors
if(C?.holder?.fakekey)
msg += " <i>(as [C.holder.fakekey])</i>"

if(isobserver(C.mob))
Expand All @@ -62,18 +64,10 @@ GLOBAL_PROTECT(mentor_verbs)

if(C.is_afk())
msg += " (AFK)"
msg += "\n"
else
for(var/client/C in GLOB.mentors)
if(C.holder) continue
if(C.mentor_datum.position)
position = C.mentor_datum.position
if(C.holder && C.holder.fakekey)
msg += "\t[C.holder.fakekey] is a [position]"
else
msg += "\t[C] is a [position]"
msg += "\n"
msg += span_info("Mentorhelps are also seen by admins. If no mentors are available in game adminhelp instead and an admin will see it and respond.")
else
msg += span_info("Mentorhelps are also seen by admins. If no mentors are available in game adminhelp instead and an admin will see it and respond.")
msg += "\n"

to_chat(src, msg, confidential=TRUE)

/client/verb/mrat()
Expand Down Expand Up @@ -110,7 +104,7 @@ GLOBAL_PROTECT(mentor_verbs)
return
mentor_position = mentor_datum.position
remove_mentor_verbs()
mentor_datum = null
QDEL_NULL(mentor_datum)
GLOB.mentors -= src
add_verb(src, /client/proc/rementor)
to_chat(src, span_interface("You are now a normal player."), confidential=TRUE)
Expand Down

0 comments on commit de78fe0

Please sign in to comment.