Fix autopunctuation issues. (#6578)

Autopunctuation will no longer autopunctuate if markup (* or /) is present at the end of the sentence.

It will also no longer input an empty period if you put nothing in the chat box.

Fixes #6536
This commit is contained in:
Matt Atlas
2019-06-19 21:01:15 +03:00
committed by Erki
parent d00ef60895
commit e26bba7b28
2 changed files with 12 additions and 4 deletions
+5 -4
View File
@@ -161,6 +161,11 @@ proc/get_radio_key_from_channel(var/channel)
var/message_mode = parse_message_mode(message, "headset")
var/static/list/correct_punctuation = list("!" = TRUE, "." = TRUE, "?" = TRUE, "-" = TRUE, "~" = TRUE, "*" = TRUE, "/" = TRUE)
var/ending = copytext(message, length(message), (length(message) + 1))
if(ending && !correct_punctuation[ending])
message += "."
message = process_chat_markup(message, list("~", "_"))
switch(copytext(message,1,2))
@@ -176,10 +181,6 @@ proc/get_radio_key_from_channel(var/channel)
message = trim_left(message)
var/ending = copytext(message, length(message), (length(message) + 1))
if(ending != "!" && ending != "." && ending != "?" && ending != "-")
message += "."
//parse the language code and consume it
if(!speaking)
speaking = parse_language(message)