mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-14 15:48:04 +03:00
ReHLDS API: Use maxclientslimit instead maxclients
This commit is contained in:
parent
923c838807
commit
20200f7eaa
@ -162,7 +162,7 @@ bool EXT_FUNC CRehldsServerStatic::IsLogActive()
|
||||
|
||||
IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id)
|
||||
{
|
||||
if (id < 0 || id >= g_psvs.maxclients)
|
||||
if (id < 0 || id >= g_psvs.maxclientslimit)
|
||||
Sys_Error("%s: invalid id provided: %d", __func__, id);
|
||||
|
||||
return g_GameClients[id];
|
||||
@ -170,7 +170,7 @@ IGameClient* EXT_FUNC CRehldsServerStatic::GetClient(int id)
|
||||
|
||||
client_t* EXT_FUNC CRehldsServerStatic::GetClient_t(int id)
|
||||
{
|
||||
if (id < 0 || id >= g_psvs.maxclients)
|
||||
if (id < 0 || id >= g_psvs.maxclientslimit)
|
||||
Sys_Error("%s: invalid id provided: %d", __func__, id);
|
||||
|
||||
return &g_psvs.clients[id];
|
||||
@ -178,7 +178,7 @@ client_t* EXT_FUNC CRehldsServerStatic::GetClient_t(int id)
|
||||
|
||||
int EXT_FUNC CRehldsServerStatic::GetIndexOfClient_t(client_t* client)
|
||||
{
|
||||
if (client < g_psvs.clients || client >= &g_psvs.clients[g_psvs.maxclients])
|
||||
if (client < g_psvs.clients || client >= &g_psvs.clients[g_psvs.maxclientslimit])
|
||||
return -1;
|
||||
|
||||
if (((size_t)client - (size_t)g_psvs.clients) % sizeof(client_t))
|
||||
@ -286,7 +286,7 @@ IGameClient* GetRehldsApiClient(client_t* cl)
|
||||
return NULL; //I think it's logical.
|
||||
|
||||
int idx = cl - g_psvs.clients;
|
||||
if (idx < 0 || idx >= g_psvs.maxclients)
|
||||
if (idx < 0 || idx >= g_psvs.maxclientslimit)
|
||||
{
|
||||
Sys_Error("%s: Invalid client index %d", __func__, idx);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user