From f8f7febe41311ff3562c57a10672e3a62174104b Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 23 Dec 2008 11:55:46 +0000 Subject: (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. --- src/network/network_chat_gui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/network/network_chat_gui.cpp') 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)); -- cgit v1.2.3-54-g00ecf