Merge pull request #7247 from Citadel-Station-13/upstream-merge-38672

[MIRROR] Fix the MOTD having too many newlines
This commit is contained in:
LetterJay
2018-07-01 09:26:04 -05:00
committed by GitHub
3 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -233,7 +233,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR)
var/motd = global.config.motd
if(motd)
to_chat(src, "<div class=\"motd\">[motd]</div>")
to_chat(src, "<div class=\"motd\">[motd]</div>", handle_whitespace=FALSE)
else
to_chat(src, "<span class='notice'>The Message of the Day has not been set.</span>")
+6 -4
View File
@@ -97,7 +97,8 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
for(var/message in messageQueue)
to_chat(owner, message)
// whitespace has already been handled by the original to_chat
to_chat(owner, message, handle_whitespace=FALSE)
messageQueue = null
sendClientData()
@@ -175,7 +176,7 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
//Global chat procs
/proc/to_chat(target, message)
/proc/to_chat(target, message, handle_whitespace=TRUE)
if(!target)
return
@@ -201,8 +202,9 @@ GLOBAL_DATUM_INIT(iconCache, /savefile, new("data/iconCache.sav")) //Cache of ic
//Some macros remain in the string even after parsing and fuck up the eventual output
message = replacetext(message, "\improper", "")
message = replacetext(message, "\proper", "")
message = replacetext(message, "\n", "<br>")
message = replacetext(message, "\t", "[GLOB.TAB][GLOB.TAB]")
if(handle_whitespace)
message = replacetext(message, "\n", "<br>")
message = replacetext(message, "\t", "[GLOB.TAB][GLOB.TAB]")
for(var/I in targets)
//Grab us a client if possible
+1 -1
View File
@@ -11,7 +11,7 @@
var/motd = global.config.motd
if(motd)
to_chat(src, "<div class=\"motd\">[motd]</div>")
to_chat(src, "<div class=\"motd\">[motd]</div>", handle_whitespace=FALSE)
if(GLOB.admin_notice)
to_chat(src, "<span class='notice'><b>Admin Notice:</b>\n \t [GLOB.admin_notice]</span>")