Make say handling short out earlier to prevent runtimes

The code does not appear to expect a message of the form "", but
does not carry out the check for a message until much later
This commit is contained in:
oranges
2016-09-26 06:20:40 +00:00
parent 1d09638ef4
commit df3f2db7ea
+3 -3
View File
@@ -60,6 +60,9 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN)
/mob/living/say(message, bubble_type,var/list/spans = list())
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(!message || message == "")
return
if(stat == DEAD)
say_dead(message)
@@ -93,9 +96,6 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN)
if(message_mode != MODE_WHISPER) //whisper() calls treat_message(); double process results in "hisspering"
message = treat_message(message)
if(!message)
return
spans += get_spans()
//Log of what we've said, plain message, no spans or junk