(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.

This commit is contained in:
rubidium
2008-12-23 11:55:46 +00:00
parent 52fb6b7d7c
commit f8f7febe41
5 changed files with 15 additions and 16 deletions

View File

@@ -23,16 +23,16 @@ struct NetworkClientInfo {
static NetworkClientInfo *GetNetworkClientInfo(int ci)
{
extern NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
extern NetworkClientInfo _network_client_info[MAX_CLIENT_SLOTS];
return &_network_client_info[ci];
}
static inline bool IsValidNetworkClientInfoIndex(ClientIndex index)
{
return (uint)index < MAX_CLIENT_INFO && GetNetworkClientInfo(index)->IsValid();
return (uint)index < MAX_CLIENT_SLOTS && GetNetworkClientInfo(index)->IsValid();
}
#define FOR_ALL_CLIENT_INFOS_FROM(d, start) for (ci = GetNetworkClientInfo(start); ci != GetNetworkClientInfo(MAX_CLIENT_INFO); ci++) if (ci->IsValid())
#define FOR_ALL_CLIENT_INFOS_FROM(d, start) for (ci = GetNetworkClientInfo(start); ci != GetNetworkClientInfo(MAX_CLIENT_SLOTS); ci++) if (ci->IsValid())
#define FOR_ALL_CLIENT_INFOS(d) FOR_ALL_CLIENT_INFOS_FROM(d, 0)
#endif /* ENABLE_NETWORK */