Fixed bug in Q3A that bots would carry over between SP campaign maps

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5393 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Eukara 2019-01-27 04:57:50 +00:00
parent e64409274a
commit c87535ecef
1 changed files with 6 additions and 1 deletions

View File

@ -3320,13 +3320,18 @@ void SVQ3_NewMapConnects(void)
{
int i;
qintptr_t ret;
/* Kick old bots in SP - eukara */
cvar_t *gametype;
gametype = Cvar_Get("g_gametype", "", CVAR_LATCH|CVAR_SERVERINFO, "Q3 compatability");
for (i = 0; i < sv.allocated_client_slots; i++)
{
if (svs.clients[i].state < cs_connected)
continue;
ret = VM_Call(q3gamevm, GAME_CLIENT_CONNECT, i, false, svs.clients[i].protocol == SCP_BAD);
if (ret)
if (ret || (gametype->value == 2 && svs.clients[i].protocol == SCP_BAD))
{
SV_DropClient(&svs.clients[i]);
}