Fixes for podium bots loading

- Handle bot spectator on spawn purely in P_SpawnPlayer from now on
- Don't give podium players flashing tics
- Don't call P_MovePlayerToStarpost during podium. (Needs further fixing in another branch, since this also apparently affects bot spawning in all maps.)
- Update mobj_t pointers in CL_ClearPlayer if G_GamestateUsesLevel()
- Forcefully set initial podium waypoint if jointime <= 1
- Use G_SpawnPlayer consistently in P_InitPlayers for podium
This commit is contained in:
Sally Coolatta 2023-03-03 15:41:31 -05:00
parent 2dae6833c2
commit a1976aa43d
5 changed files with 6 additions and 10 deletions

View file

@ -2542,7 +2542,7 @@ void CL_ClearPlayer(INT32 playernum)
int i;
// Handle mobj_t pointers.
if (gamestate == GS_LEVEL)
if (G_GamestateUsesLevel() == true)
{
if (players[playernum].follower)
{
@ -3771,9 +3771,6 @@ static void Got_AddBot(UINT8 **p, INT32 playernum)
sprintf(player_names[newplayernum], "%s", skins[skinnum].realname);
SetPlayerSkinByNum(newplayernum, skinnum);
players[newplayernum].spectator = !(gametyperules & GTR_BOTS)
|| (grandprixinfo.gp == true && grandprixinfo.eventmode != GPEVENT_NONE);
if (netgame)
{
HU_AddChatText(va("\x82*Bot %d has been added to the game", newplayernum+1), false);

View file

@ -2742,7 +2742,7 @@ void G_MovePlayerToSpawnOrStarpost(INT32 playernum)
#else
// Player's first spawn should be at the "map start".
// I.e. level load or join mid game.
if (leveltime > starttime && players[playernum].jointime > 0)
if (leveltime > starttime && players[playernum].jointime > 1 && K_PodiumSequence() == false)
P_MovePlayerToStarpost(playernum);
else
P_MovePlayerToSpawn(playernum, G_FindMapStart(playernum));

View file

@ -8527,7 +8527,7 @@ static void K_UpdatePodiumWaypoints(player_t *const player)
{
if ((player->currentwaypoint == NULL)
&& (player->position > 0 && player->position <= MAXPLAYERS)
&& (leveltime <= 2))
&& (leveltime <= introtime || player->jointime <= 1))
{
// Initialize our first waypoint to the one that
// matches our position.

View file

@ -11746,8 +11746,7 @@ void P_SpawnPlayer(INT32 playernum)
else if (p->bot)
{
if (K_PodiumSequence() == false
&& grandprixinfo.gp == true
&& grandprixinfo.eventmode != GPEVENT_NONE)
&& (!(gametyperules & GTR_BOTS) || (grandprixinfo.gp == true && grandprixinfo.eventmode != GPEVENT_NONE)))
{
// Bots aren't supposed to be here.
p->spectator = true;
@ -11811,7 +11810,7 @@ void P_SpawnPlayer(INT32 playernum)
p->skincolor = skincolor_blueteam;
}
if (leveltime > introtime)
if (leveltime > introtime && K_PodiumSequence() == false)
p->flashing = K_GetKartFlashing(p); // Babysitting deterrent
mobj = P_SpawnMobj(0, 0, 0, MT_PLAYER);

View file

@ -7363,7 +7363,7 @@ static void P_InitPlayers(void)
players[i].mo = NULL;
if (!(gametyperules & GTR_CIRCUIT))
if (!(gametyperules & GTR_CIRCUIT) && K_PodiumSequence() == false)
{
G_DoReborn(i);
}