Fixes invalid name error showing up when cancelling the input (#39781)

The 'invalid name' message won't appear now if the user cancels it when
changing his name on the character setup window
This commit is contained in:
Aranclanos
2018-08-19 15:01:08 -07:00
committed by Tad Hardesty
parent 242d00dc38
commit 24d3207421
+6 -4
View File
@@ -1102,11 +1102,13 @@ GLOBAL_LIST_EMPTY(preferences_datums)
ghost_others = GHOST_OTHERS_SIMPLE
if("name")
var/new_name = reject_bad_name( input(user, "Choose your character's name:", "Character Preference") as text|null )
var/new_name = input(user, "Choose your character's name:", "Character Preference") as text|null
if(new_name)
real_name = new_name
else
to_chat(user, "<font color='red'>Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .</font>")
new_name = reject_bad_name(new_name)
if(new_name)
real_name = new_name
else
to_chat(user, "<font color='red'>Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .</font>")
if("age")
var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null