diff --git a/rehlds/rehlds/rehlds_interfaces_impl.cpp b/rehlds/rehlds/rehlds_interfaces_impl.cpp index 5c2bdb8..f4d3c0b 100644 --- a/rehlds/rehlds/rehlds_interfaces_impl.cpp +++ b/rehlds/rehlds/rehlds_interfaces_impl.cpp @@ -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); }