fixed amb1373 - off-by-one error a helper routine prevented CS natives from using the last client

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401863
This commit is contained in:
David Anderson 2008-01-22 22:53:41 +00:00
parent 85eaa31374
commit aba5378f95

View File

@ -49,14 +49,16 @@ inline CBaseEntity *GetCBaseEntity(int num, bool isplayer)
return NULL;
}
if (num > 0 && num < playerhelpers->GetMaxClients())
if (num > 0 && num <= playerhelpers->GetMaxClients())
{
IGamePlayer *pPlayer = playerhelpers->GetGamePlayer(pEdict);
if (!pPlayer || !pPlayer->IsConnected())
{
return NULL;
}
} else if (isplayer) {
}
else if (isplayer)
{
return NULL;
}