From afddfcb2b1a37358459158ce83a64535f13cd05e Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 23 Dec 2008 20:52:27 +0000 Subject: (svn r14730) -Codechange: remove the need for networkclientsockets and networkclientinfo structs to be in a contiguous piece of memory and put them in a pool. -Note: 255 should really be enough for now... making it any more means network protocol bumps. --- src/network/network_chat_gui.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 fc36bec53..4f4447779 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -301,8 +301,13 @@ struct NetworkChatWindow : public QueryStringBaseWindow { /* First, try clients */ if (*item < MAX_CLIENT_SLOTS) { /* Skip inactive clients */ - while (GetNetworkClientInfo(*item)->client_id == INVALID_CLIENT_ID && *item < MAX_CLIENT_SLOTS) (*item)++; - if (*item < MAX_CLIENT_SLOTS) return GetNetworkClientInfo(*item)->client_name; + NetworkClientInfo *ci; + FOR_ALL_CLIENT_INFOS_FROM(ci, *item + 1) break; + if (ci != NULL) { + *item = ci->index; + return ci->client_name; + } + *item = MAX_CLIENT_SLOTS; } /* Then, try townnames */ -- cgit v1.2.3-54-g00ecf