diff options
author | rubidium <rubidium@openttd.org> | 2008-12-23 11:55:46 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-12-23 11:55:46 +0000 |
commit | f8f7febe41311ff3562c57a10672e3a62174104b (patch) | |
tree | 0e0f56357371c5504e04f2c93c6baebc89f00607 /src/network/network_chat_gui.cpp | |
parent | 52fb6b7d7cec0734fb341939adce5199eeca7db6 (diff) | |
download | openttd-f8f7febe41311ff3562c57a10672e3a62174104b.tar.xz |
(svn r14725) -Change: make it clearer why (and that) MAX_CLIENTS isn't the amount of slots in the array, but one less as a dedicated server takes a slot too.
Diffstat (limited to 'src/network/network_chat_gui.cpp')
-rw-r--r-- | src/network/network_chat_gui.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 739ef6454..fc36bec53 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -299,19 +299,19 @@ struct NetworkChatWindow : public QueryStringBaseWindow { static char chat_tab_temp_buffer[64]; /* First, try clients */ - if (*item < MAX_CLIENT_INFO) { + if (*item < MAX_CLIENT_SLOTS) { /* Skip inactive clients */ - while (GetNetworkClientInfo(*item)->client_id == INVALID_CLIENT_ID && *item < MAX_CLIENT_INFO) (*item)++; - if (*item < MAX_CLIENT_INFO) return GetNetworkClientInfo(*item)->client_name; + while (GetNetworkClientInfo(*item)->client_id == INVALID_CLIENT_ID && *item < MAX_CLIENT_SLOTS) (*item)++; + if (*item < MAX_CLIENT_SLOTS) return GetNetworkClientInfo(*item)->client_name; } /* Then, try townnames */ /* Not that the following assumes all town indices are adjacent, ie no * towns have been deleted. */ - if (*item <= (uint)MAX_CLIENT_INFO + GetMaxTownIndex()) { + if (*item <= (uint)MAX_CLIENT_SLOTS + GetMaxTownIndex()) { const Town *t; - FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_INFO) { + FOR_ALL_TOWNS_FROM(t, *item - MAX_CLIENT_SLOTS) { /* Get the town-name via the string-system */ SetDParam(0, t->index); GetString(chat_tab_temp_buffer, STR_TOWN, lastof(chat_tab_temp_buffer)); |