Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 6660419

Browse files
authored
Fixes a few mentor bugs (#22825)
* Mentor fixes * That may have been the actual ID and not their alias * OOC tag fix * Not another runtime * Fixes discord mentor messages not being logged in database or mentor tickets * Fixes bad indents * This is why you need to be careful when copypasting
1 parent 5db9e4e commit 6660419

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

code/modules/admin/holder2.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ GLOBAL_PROTECT(href_token)
122122

123123
if (deadmined)
124124
activate()
125+
if(C.mentor_datum)
126+
C.mentor_position = C.mentor_datum.position
125127
owner = C
126128
ip_cache = C.address
127129
cid_cache = C.computer_id

yogstation/code/datums/world_topic.dm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ GLOBAL_VAR_INIT(mentornoot, FALSE)
8686
SEND_SOUND(C, sound('sound/misc/nootnoot.ogg'))
8787
else
8888
SEND_SOUND(C, sound('sound/items/bikehorn.ogg'))
89+
var/datum/DBQuery/add_mhelp_query = SSdbcore.NewQuery(
90+
"INSERT INTO `[format_table_name("mentor_interactions")]` (round_id, ckey, ckey_mentor, target_ckey, target_mentor, message) VALUES (:round, :send, :smentor, :receive, :rmentor, :msg);",
91+
list("round" = GLOB.round_id, "send" = from, "smentor" = TRUE, "receive" = C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
92+
)
93+
if(!add_mhelp_query.Execute())
94+
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")
95+
qdel(add_mhelp_query)
96+
if(C.ckey in SSYogs.mentortickets)
97+
var/datum/mentorticket/T = SSYogs.mentortickets[C.ckey]
98+
T.log += "<b>[from]:</b> [msg]"
8999
to_chat(C, "<font color='purple'>Mentor PM from-<b>[discord_mentor_link(from, from_id)]</b>: [msg]</font>", confidential = TRUE)
90100
var/show_char_recip = !C.is_mentor() && CONFIG_GET(flag/mentors_mobname_only)
91101
for(var/client/X in GLOB.mentors | GLOB.permissions.admins)

yogstation/code/modules/mentor/mentor_verbs.dm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ GLOBAL_PROTECT(mentor_verbs)
6464

6565
if(C.is_afk())
6666
msg += " (AFK)"
67-
else
68-
msg += span_info("Mentorhelps are also sent to Discord. If no mentors are available in game mentorhelp anyways and a mentor on Discord may see it and respond.")
6967
msg += "\n"
68+
msg += span_info("Mentorhelps are also sent to Discord. If no mentors are available in game mentorhelp anyways and a mentor on Discord may see it and respond.")
7069

7170
to_chat(src, msg, confidential=TRUE)
7271

yogstation/code/modules/mentor/mentorpm.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191
var/datum/DBQuery/add_mhelp_query = SSdbcore.NewQuery(
9292
"INSERT INTO `[format_table_name("mentor_interactions")]` (round_id, ckey, ckey_mentor, target_ckey, target_mentor, message) VALUES (:round, :send, :smentor, :receive, :rmentor, :msg);",
93-
list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = C.ckey, "rmentor" = C.is_mentor(), "msg" = msg)
93+
list("round" = GLOB.round_id, "send" = ckey, "smentor" = is_mentor(), "receive" = discord_id ? whom : C.ckey, "rmentor" = discord_id ? TRUE : C.is_mentor(), "msg" = msg)
9494
)
9595
if(!add_mhelp_query.Execute())
9696
message_admins("Failed insert mhelp into mhelp DB. Check the SQL error logs for more details.")

0 commit comments

Comments
 (0)