Fix the spectating bots in GP issue a different way

The solution in 67c2ae021b happens too late for K_TimeAttackRules
This commit is contained in:
toaster 2023-08-31 16:46:46 +01:00
parent 43eb61dfcb
commit 1dd2e7031a
3 changed files with 18 additions and 19 deletions

View file

@ -307,6 +307,8 @@ void K_LoadGrandPrixSaveGame(void)
players[i].botvars.rival = savedata.bots[i].rival;
players[i].score = savedata.bots[i].score;
players[i].spectator = !(gametyperules & GTR_BOTS) || (grandprixinfo.eventmode != GPEVENT_NONE);
}
}
@ -379,6 +381,21 @@ void K_UpdateGrandPrixBots(void)
return;
}
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || !players[i].bot)
{
continue;
}
players[i].spectator = !(gametyperules & GTR_BOTS) || (grandprixinfo.eventmode != GPEVENT_NONE);
}
if (grandprixinfo.wonround == false)
{
return;
}
// Find the rival.
for (i = 0; i < MAXPLAYERS; i++)
{

View file

@ -11801,24 +11801,6 @@ void P_SpawnPlayer(INT32 playernum)
if (justjoined)
G_SpectatePlayerOnJoin(playernum);
if (p->bot && !demo.playback) // Don't mess with spectator values since the demo setup handles them already.
{
if (K_PodiumSequence() == true)
; // This is too late to correct spectator status. Whatever state we're in at this point, our (dog) bed is made.
else if (!(gametyperules & GTR_BOTS)
|| (grandprixinfo.gp == true
&& grandprixinfo.eventmode != GPEVENT_NONE))
{
// Bots aren't supposed to be here.
p->spectator = true;
}
else
{
// No point in a spectating bot!
p->spectator = false;
}
}
if (G_GametypeHasTeams())
{
// If you're in a team game and you don't have a team assigned yet...

View file

@ -8559,7 +8559,7 @@ void P_PostLoadLevel(void)
K_InitGrandPrixBots();
grandprixinfo.initalize = false;
}
else if (grandprixinfo.wonround == true)
else
{
K_UpdateGrandPrixBots();
grandprixinfo.wonround = false;