[Bots]: Fix (#932)
This commit is contained in:
parent
9401543a13
commit
23bfc3e89a
@ -379,9 +379,26 @@ namespace Components
|
|||||||
return Game::svs_clients[clientNum].ping;
|
return Game::svs_clients[clientNum].ping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Bots::IsFull()
|
||||||
|
{
|
||||||
|
auto i = 0;
|
||||||
|
while (i < *Game::svs_clientCount)
|
||||||
|
{
|
||||||
|
if (Game::svs_clients[i].header.state == Game::CS_FREE)
|
||||||
|
{
|
||||||
|
// Free slot was found
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return i == *Game::svs_clientCount;
|
||||||
|
}
|
||||||
|
|
||||||
void Bots::SV_DirectConnect_Full_Check()
|
void Bots::SV_DirectConnect_Full_Check()
|
||||||
{
|
{
|
||||||
if (!sv_replaceBots->current.enabled)
|
if (!sv_replaceBots->current.enabled && !IsFull())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -440,6 +457,12 @@ namespace Components
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IsFull())
|
||||||
|
{
|
||||||
|
Logger::Warning(Game::CON_CHANNEL_DONT_FILTER, "Server is full.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::size_t count = 1;
|
std::size_t count = 1;
|
||||||
|
|
||||||
if (params->size() > 1)
|
if (params->size() > 1)
|
||||||
|
@ -33,5 +33,7 @@ namespace Components
|
|||||||
static void G_SelectWeaponIndex_Hk();
|
static void G_SelectWeaponIndex_Hk();
|
||||||
|
|
||||||
static int SV_GetClientPing_Hk(int clientNum);
|
static int SV_GetClientPing_Hk(int clientNum);
|
||||||
|
|
||||||
|
static bool IsFull();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user