ID:139671
 
Code:
mob
verb
Roleplay()
set category = "Misc."
usr.overlays += 'rpbubble.dmi'
var/msg = input("Roleplay") as message | null
if(msg == null || msg == "" || !(length(msg)))
usr.overlays -= 'rpbubble.dmi'
return
msg = " " + msg
var/i = findtext(msg, " \"") // Look for the " in the message.
while(i)// When it finds the "
var/msgStart = copytext(msg, 1, i) + " <font color = white>\"" //+ copytext(msg,i+length("\"")+1))
var/msgEnd = copytext(msg,i+length("\"")+1)
var/check = findtext(msgEnd, "\" ")
var/check2 = findtext(msgEnd, "\".")
if(check)
msgEnd = copytext(msgEnd,1, check) + "\"</font><font color = yellow> " + copytext(msgEnd, check+length("\"")+1)
if(check2)
msgEnd = copytext(msgEnd,1, check2) + "\"</font><font color = yellow>." + copytext(msgEnd, check2+length("\"")+1)
msg = msgStart + msgEnd
i = findtext(msg, " \"")
i = findtext(msg, " (") // Look for the " in the message.
while(i)// When it finds the "
var/msgStart = copytext(msg, 1, i) + " <font color = #52F3FF>(" //+ copytext(msg,i+length("\"")+1))
var/msgEnd = copytext(msg,i+length("\"")+1)
var/check = findtext(msgEnd, "\" ")
var/check2 = findtext(msgEnd, "\".")
if(check)
msgEnd = copytext(msgEnd,1, check) + "\"</font><font color = yellow> " + copytext(msgEnd, check+length("\"")+1)
if(check2)
msgEnd = copytext(msgEnd,1, check2) + "\"</font><font color = yellow>." + copytext(msgEnd, check2+length("\"")+1)
msg = msgStart + msgEnd
i = findtext(msg, " \"")
hearers(10,usr) << "<font color = yellow><b>[usr.name] [msg]</b></font>" // Send it out!
if(src.TempVars["AstralProjecting"])
hearers(10,usr.client.eye) << "<FONT FACE=Arial COLOR=#FFFFFF>[usr.name] says: [html_encode(msg)]</FONT>"
for(var/AP/A in view(10,usr.client.eye))
A.owner << "<font color = yellow><b>[usr.name] [msg]</b></font>"
for(var/mob/M in world)
if(M.TempVars["AdminMonitor"])
M << output("<font color = #0174DF><b>[usr.name] [msg]</b></font>","DefaultOutput.output2")
spawn() if(LogStuff&&usr&&usr.client) text2file("RP: [usr], [msg]<br>", "logs/[usr.name].[usr.client ? usr.key : "AI"].txt")
usr.overlays -= 'rpbubble.dmi'


Problem description:
Basically, this was always working. I changed one thing, and it started crashing the game when I hit "Okay" to post my RP.

Also, a few other bugs are that if you don't space before, or after the ", it all turns white, and if you end the dialog (end quotation) at paragraph end, it makes the rest of rp white.

Edit: Just for reference, it shows NOTHING in the error log.
Okay, I commented crap out, it happens when displaying the message, apparently. Are there any things my Output should have checked or unchecked in interface that'd bug this?
Looping through every mob in the world has the potential to crash and burn. Either maintain a list of mobs you are interested in or, at the very least, only loop through clients (with for(var/client/C)).