summaryrefslogtreecommitdiff
path: root/src/network/network_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/network_gui.cpp')
-rw-r--r--src/network/network_gui.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 1c80f7f3c..15cf24f49 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -808,8 +808,7 @@ public:
}
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] != ' ') {
+ if (NetworkIsValidClientName(this->name_editbox.text.buf)) {
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));