diff --git a/src/g_game.c b/src/g_game.c index 1f16f07c3..be29bfd3b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2097,12 +2097,18 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps) roundconditions_t roundconditions; boolean saveroundconditions; + // This needs to be first, to permit it to wipe extra information + jointime = players[player].jointime; + if (jointime <= 1) + { + G_SpectatePlayerOnJoin(player); + betweenmaps = true; + } + score = players[player].score; lives = players[player].lives; ctfteam = players[player].ctfteam; - jointime = players[player].jointime; - splitscreenindex = players[player].splitscreenindex; spectator = players[player].spectator; @@ -2891,7 +2897,7 @@ void G_SpectatePlayerOnJoin(INT32 playernum) continue; // Prevent splitscreen hosters/joiners from only adding 1 player at a time in empty servers (this will also catch yourself) - if (!players[i].jointime) + if (players[i].jointime <= 1) continue; // A ha! An established player! It's time to spectate diff --git a/src/k_kart.c b/src/k_kart.c index 31567ea1a..36c7d09ad 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -178,30 +178,7 @@ void K_TimerInit(void) if ((gametyperules & (GTR_ROLLINGSTART|GTR_CIRCUIT)) == (GTR_ROLLINGSTART|GTR_CIRCUIT)) { S_StartSound(NULL, sfx_s25f); - - for (i = 0; i < MAXPLAYERS; i++) - { - player_t *player = NULL; - - if (playeringame[i] == false) - { - continue; - } - - player = &players[i]; - if (player->spectator == true) - { - continue; - } - - if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true) - { - continue; - } - - // Rolling start? lol - P_InstaThrust(player->mo, player->mo->angle, K_GetKartSpeed(player, false, false)); - } + // The actual push occours in P_InitPlayers } else if (skipstats != 0) { diff --git a/src/p_mobj.c b/src/p_mobj.c index f9763afb5..cd7b2d2c2 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -11791,16 +11791,11 @@ void P_SpawnPlayer(INT32 playernum) player_t *p = &players[playernum]; mobj_t *mobj; - boolean justjoined = (p->jointime <= 1); - if (p->playerstate == PST_REBORN) { - G_PlayerReborn(playernum, justjoined); + G_PlayerReborn(playernum, false); } - if (justjoined) - G_SpectatePlayerOnJoin(playernum); - if (G_GametypeHasTeams()) { // If you're in a team game and you don't have a team assigned yet... diff --git a/src/p_setup.c b/src/p_setup.c index 8c57bace8..fa397664c 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -7877,6 +7877,15 @@ static void P_InitPlayers(void) G_SpawnPlayer(i); players[i].xtralife = 0; // extra lives do not ever carry over from the previous round + + if (P_MobjWasRemoved(players[i].mo) == false && !players[i].spectator) + { + // Rooooooolllling staaaaaaart + if ((gametyperules & (GTR_ROLLINGSTART|GTR_CIRCUIT)) == (GTR_ROLLINGSTART|GTR_CIRCUIT)) + { + P_InstaThrust(players[i].mo, players[i].mo->angle, K_GetKartSpeed(&players[i], false, false)); + } + } } K_UpdateAllPlayerPositions(); @@ -8567,6 +8576,8 @@ void P_PostLoadLevel(void) K_UpdateMatchRaceBots(); } + K_TimerInit(); + P_InitPlayers(); if (metalrecording) @@ -8575,8 +8586,6 @@ void P_PostLoadLevel(void) G_BeginRecording(); // I AM NOW READY TO RECORD. demo.deferstart = true; - K_TimerInit(); - nextmapoverride = 0; skipstats = 0;