summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-27 21:30:44 +0000
committerfrosch <frosch@openttd.org>2012-11-27 21:30:44 +0000
commitb88419540040e07e931696e0984595b3a64766c1 (patch)
treef798a00019e32627265a29214be078fe1bf5e7ff
parent9aeeb5acb9384efe9ab77f6b30d4b067bb5ea612 (diff)
downloadopenttd-b88419540040e07e931696e0984595b3a64766c1.tar.xz
(svn r24768) -Fix: Adjust a comment to reflect some more truth.
-rw-r--r--src/network/network_gui.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 685a1e38c..d6e6f070f 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -837,13 +837,15 @@ public:
virtual void OnEditboxChanged(int wid)
{
- if (wid == WID_NG_CLIENT) {
- /* The name is only allowed when it starts with a letter! */
- if (!StrEmpty(this->name_editbox.text.buf) && this->name_editbox.text.buf[0] != ' ') {
- strecpy(_settings_client.network.client_name, this->name_editbox.text.buf, lastof(_settings_client.network.client_name));
- } else {
- strecpy(_settings_client.network.client_name, "Player", lastof(_settings_client.network.client_name));
- }
+ switch (wid) {
+ case WID_NG_CLIENT:
+ /* Make sure the name does not start with a space, so TAB completion works */
+ if (!StrEmpty(this->name_editbox.text.buf) && this->name_editbox.text.buf[0] != ' ') {
+ strecpy(_settings_client.network.client_name, this->name_editbox.text.buf, lastof(_settings_client.network.client_name));
+ } else {
+ strecpy(_settings_client.network.client_name, "Player", lastof(_settings_client.network.client_name));
+ }
+ break;
}
}