Move bot updates before P_InitPlayers

This commit is contained in:
Sally Coolatta 2023-03-05 14:12:03 -05:00
parent 2ebf8ebb8c
commit 34112be38e
2 changed files with 25 additions and 22 deletions

View file

@ -2940,9 +2940,14 @@ mapthing_t *G_FindPodiumStart(INT32 playernum)
UINT8 i;
UINT8 pos = 0;
if (!playeringame[playernum] || players[playernum].spectator)
{
return playerstarts[0]; // go to first spot if you're a spectator
}
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
if (!playeringame[i] || players[i].spectator)
{
continue;
}

View file

@ -7382,6 +7382,25 @@ static void P_InitGametype(void)
spectateGriefed = 0;
K_CashInPowerLevels(); // Pushes power level changes even if intermission was skipped
if (grandprixinfo.gp == true)
{
if (grandprixinfo.initalize == true)
{
K_InitGrandPrixBots();
grandprixinfo.initalize = false;
}
else if (grandprixinfo.wonround == true)
{
K_UpdateGrandPrixBots();
grandprixinfo.wonround = false;
}
}
else if (!modeattacking)
{
// We're in a Match Race, use simplistic randomized bots.
K_UpdateMatchRaceBots();
}
P_InitPlayers();
if (modeattacking && !demo.playback)
@ -7969,27 +7988,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
lastmaploaded = gamemap; // HAS to be set after saving!!
}
if (reloadinggamestate)
;
else if (grandprixinfo.gp == true)
{
if (grandprixinfo.initalize == true)
{
K_InitGrandPrixBots();
grandprixinfo.initalize = false;
}
else if (grandprixinfo.wonround == true)
{
K_UpdateGrandPrixBots();
grandprixinfo.wonround = false;
}
}
else if (!modeattacking)
{
// We're in a Match Race, use simplistic randomized bots.
K_UpdateMatchRaceBots();
}
if (!fromnetsave) // uglier hack
{ // to make a newly loaded level start on the second frame.
INT32 buf = gametic % BACKUPTICS;