diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 7d6c017b77..7d8eb108f3 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -94,6 +94,8 @@ // Used to get a properly sanitized multiline input, of max_length /proc/stripped_multiline_input(mob/user, message = "", title = "", default = "", max_length=MAX_MESSAGE_LEN, no_trim=FALSE) var/name = input(user, message, title, default) as message|null + if(isnull(name)) // Return null if canceled. + return null if(no_trim) return copytext(html_encode(name), 1, max_length) else diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 8e4891fb70..d80f56c8c8 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1458,7 +1458,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN) if("flavor_text") - var/msg = stripped_multiline_input(usr,"Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!","Flavor Text",html_decode(features["flavor_text"]), MAX_MESSAGE_LEN*2, TRUE) as null|message + var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", html_decode(features["flavor_text"]), MAX_MESSAGE_LEN*2, TRUE) if(!isnull(msg)) msg = copytext(msg, 1, MAX_MESSAGE_LEN*2) features["flavor_text"] = msg diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index 3bd23c1b80..158aabc80a 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -8,9 +8,9 @@ set src in usr if(usr != src) usr << "No." - var/msg = input(usr,"Set the flavor text in your 'examine' verb. Can also be used for OOC notes about your character.","Flavor Text",html_decode(flavor_text)) as message|null - - if(msg != null) + var/msg = stripped_multiline_input(usr, "Set the flavor text in your 'examine' verb. This can also be used for OOC notes and preferences!", "Flavor Text", html_decode(flavor_text), MAX_MESSAGE_LEN*2, TRUE) + + if(!isnull(msg)) msg = copytext(msg, 1, MAX_MESSAGE_LEN) msg = html_encode(msg)