1
0
Fork 0

(svn r24768) -Fix: Adjust a comment to reflect some more truth.

release/1.3
frosch 2012-11-27 21:30:44 +00:00
parent 9aeeb5acb9
commit b884195400
1 changed files with 9 additions and 7 deletions

View File

@ -837,13 +837,15 @@ public:
virtual void OnEditboxChanged(int wid) virtual void OnEditboxChanged(int wid)
{ {
if (wid == WID_NG_CLIENT) { switch (wid) {
/* The name is only allowed when it starts with a letter! */ case WID_NG_CLIENT:
if (!StrEmpty(this->name_editbox.text.buf) && this->name_editbox.text.buf[0] != ' ') { /* Make sure the name does not start with a space, so TAB completion works */
strecpy(_settings_client.network.client_name, this->name_editbox.text.buf, lastof(_settings_client.network.client_name)); if (!StrEmpty(this->name_editbox.text.buf) && this->name_editbox.text.buf[0] != ' ') {
} else { strecpy(_settings_client.network.client_name, this->name_editbox.text.buf, lastof(_settings_client.network.client_name));
strecpy(_settings_client.network.client_name, "Player", lastof(_settings_client.network.client_name)); } else {
} strecpy(_settings_client.network.client_name, "Player", lastof(_settings_client.network.client_name));
}
break;
} }
} }