Skip to content

Commit

Permalink
fix ooc tomfoolery, also spans
Browse files Browse the repository at this point in the history
  • Loading branch information
LetterN committed Dec 20, 2024
1 parent 8f08738 commit d8ad4c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2043,21 +2043,21 @@
/atom/proc/extra_admin_link()
return

/mob/extra_admin_link(var/source)
/mob/extra_admin_link(source)
if(client && eyeobj)
return "|<A HREF='?[source];adminplayerobservejump=\ref[eyeobj]'>EYE</A>"
return "|<A HREF='?[source];[HrefToken()];adminplayerobservejump=[REF(eyeobj)]'>EYE</A>"

/mob/observer/dead/extra_admin_link(var/source)
if(mind && mind.current)
return "|<A HREF='?[source];adminplayerobservejump=\ref[mind.current]'>BDY</A>"
/mob/observer/dead/extra_admin_link(source)
if(mind?.current)
return "|<A HREF='?[source];[HrefToken()];adminplayerobservejump=[REF(mind.current)]'>BDY</A>"

/proc/admin_jump_link(var/atom/target, var/source)
/proc/admin_jump_link(atom/target, source)
if(!target) return
// The way admin jump links handle their src is weirdly inconsistent...
if(istype(source, /datum/admins))
source = "src=\ref[source]"
else
source = "_src_=holder"

. = "<A HREF='?[source];adminplayerobservejump=\ref[target]'>JMP</A>"
. = "<A HREF='?[source];HrefToken()];adminplayerobservejump=[REF(target)]'>JMP</A>"
. += target.extra_admin_link(source)
18 changes: 9 additions & 9 deletions code/modules/client/verbs/ooc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@
if(!mob)
return

if(!holder)
if(isnull(holder))
if(!config_legacy.ooc_allowed)
to_chat(src, "<span class='danger'>OOC is globally muted.</span>")
to_chat(src, SPAN_DANGER("OOC is globally muted."))
return
if(!config_legacy.dooc_allowed && (mob.stat == DEAD))
to_chat(usr, "<span class='danger'>OOC for dead mobs has been turned off.</span>")
to_chat(usr, SPAN_DANGER("OOC for dead mobs has been turned off."))
return
if(prefs.muted & MUTE_OOC)
to_chat(src, "<span class='danger'>You cannot use OOC (muted).</span>")
to_chat(src, SPAN_DANGER("You cannot use OOC (muted)."))
return

if(QDELETED(src))
Expand All @@ -103,22 +103,22 @@

msg = emoji_parse(msg)

if(((msg[1] in list(".",";",":","#")) || findtext_char(msg, "say", 1, 5))) //SSticker.HasRoundStarted() &&
if(SSticker.HasRoundStarted() && ((msg[1] in list(".",";",":","#")) || findtext_char(msg, "say", 1, 5)))
if(alert("Your message \"[raw_msg]\" looks like it was meant for in game communication, say it in OOC?", "Meant for OOC?", "No", "Yes") != "Yes")
return

if(!holder)
if(handle_spam_prevention(MUTE_OOC))
return
if(findtext(msg, "byond://"))
to_chat(src, "<B>Advertising other servers is not allowed.</B>")
to_chat(src, SPAN_BOLDANNOUNCE("Advertising other servers is not allowed."))
log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]")
message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]")
return


if(!get_preference_toggle(/datum/game_preference_toggle/chat/ooc))
to_chat(src, "<span class='warning'>You have OOC muted.</span>")
to_chat(src, SPAN_DANGER("You have OOC muted."))
return

log_ooc(raw_msg, src)
Expand All @@ -142,7 +142,7 @@

var/effective_color = holder && preferences.get_entry(/datum/game_preference_entry/simple_color/admin_ooc_color)

for(var/client/target in GLOB.clients)
for(var/client/target as anything in GLOB.clients)
if(!target.initialized)
continue

Expand Down Expand Up @@ -204,7 +204,7 @@
to_chat(src, "<span class='danger'>You cannot use OOC (muted).</span>")
return
if(findtext(msg, "byond://"))
to_chat(src, "<B>Advertising other servers is not allowed.</B>")
to_chat(src, SPAN_BOLDANNOUNCE("Advertising other servers is not allowed."))
log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]")
message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]")
return
Expand Down

0 comments on commit d8ad4c2

Please sign in to comment.