summaryrefslogtreecommitdiff
path: root/src/network/network_chat_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-12-23 11:55:46 +0000
committerrubidium <rubidium@openttd.org>2008-12-23 11:55:46 +0000
commitc1b2f17bc8dcc519433b6d26b1de81a1e032572c (patch)
tree0e0f56357371c5504e04f2c93c6baebc89f00607 /src/network/network_chat_gui.cpp
parente267bee098dc96f0c2b17f5794f2f330b0acaf58 (diff)
downloadopenttd-c1b2f17bc8dcc519433b6d26b1de81a1e032572c.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.cpp10
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));