mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
lets maybe not crash on server load
This commit is contained in:
@@ -82,21 +82,8 @@ var/global/admin_ooc_colour = "#b82e00"
|
||||
if(!config.disable_ooc_emoji)
|
||||
msg = "<span class='emoji_enabled'>[msg]</span>"
|
||||
|
||||
msg = apply_formatting(msg)
|
||||
|
||||
to_chat(C, "<font color='[display_colour]'><span class='ooc'><span class='prefix'>OOC:</span> <EM>[display_name]:</EM> <span class='message'>[msg]</span></span></font>")
|
||||
|
||||
/proc/apply_formatting(message)
|
||||
var/static/regex/italics = new("(?<!\\\\)\\*(.*?)(?<!\\\\)\\*", "g")
|
||||
var/static/regex/strikethrough = new("(?<!\\\\)~(?<!\\\\)~(.*?)(?<!\\\\)~(?<!\\\\)~", "g")
|
||||
var/static/regex/escape = new("(?<!\\\\)\\\\(\[~\\*\\\\\])", "g")
|
||||
|
||||
message = italics.Replace(message, "<i>$1</i>")
|
||||
message = strikethrough.Replace(message, "<s>$1</s>")
|
||||
message = escape.Replace(message, "$1")//jesus christ, regex
|
||||
|
||||
return message
|
||||
|
||||
/proc/toggle_ooc()
|
||||
config.ooc_allowed = ( !config.ooc_allowed )
|
||||
if(config.ooc_allowed)
|
||||
|
||||
Reference in New Issue
Block a user