diff --git a/src/k_grandprix.c b/src/k_grandprix.c index 6b19b8f06..151ab7724 100644 --- a/src/k_grandprix.c +++ b/src/k_grandprix.c @@ -17,6 +17,7 @@ #include "g_game.h" #include "k_bot.h" #include "k_kart.h" +#include "k_podium.h" #include "m_random.h" #include "p_local.h" #include "r_things.h" @@ -326,6 +327,9 @@ void K_UpdateGrandPrixBots(void) UINT16 newrivalscore = 0; UINT8 i; + if (K_PodiumSequence()) + return; + for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || !players[i].bot) diff --git a/src/k_podium.c b/src/k_podium.c index 0a33844de..46de1eb79 100644 --- a/src/k_podium.c +++ b/src/k_podium.c @@ -258,9 +258,13 @@ boolean K_StartCeremony(void) // and be present for the podium for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && !players[i].spectator && !players[i].bot) + if (playeringame[i]) { - players[i].lives = max(1, players[i].lives); + if (players[i].lives < 1) + players[i].lives = 1; + + if (players[i].bot) + players[i].spectator = false; } } diff --git a/src/k_rank.c b/src/k_rank.c index ec69c78c8..61c5a49c6 100644 --- a/src/k_rank.c +++ b/src/k_rank.c @@ -360,8 +360,8 @@ gp_rank_e K_CalculateGPGrade(gpRank_t *rankData) const INT32 positionWeight = 150; const INT32 pointsWeight = 100; - const INT32 lapsWeight = 100; - const INT32 prisonsWeight = 100; + const INT32 lapsWeight = (rankData->totalLaps > 0) ? 100 : 0; + const INT32 prisonsWeight = (rankData->totalPrisons > 0) ? 100 : 0; const INT32 ringsWeight = 50; const INT32 total = positionWeight + pointsWeight + lapsWeight + prisonsWeight + ringsWeight; const INT32 continuesPenalty = 20; diff --git a/src/p_mobj.c b/src/p_mobj.c index dcedd4105..73b1db7c8 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9483,6 +9483,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) } // If target is valid, then we'll focus on it. + // See also linedef type 422 if (mobj->target != NULL && P_MobjWasRemoved(mobj->target) == false) { mobj->angle = R_PointToAngle2( @@ -11665,8 +11666,11 @@ void P_SpawnPlayer(INT32 playernum) } else if (p->bot) { - if (K_PodiumSequence() == false - && (!(gametyperules & GTR_BOTS) || (grandprixinfo.gp == true && grandprixinfo.eventmode != GPEVENT_NONE))) + 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; diff --git a/src/p_spec.c b/src/p_spec.c index ccc40d337..244f2ae6d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3026,6 +3026,7 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha { altview_t *modifyView = NULL; mobj_t *newViewMobj = NULL; + INT32 i; if (gamestate != GS_LEVEL) { @@ -3052,10 +3053,20 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha { // If titlemap, awayview.tics is ignored modifyView->tics = -1; + + R_ResetViewInterpolation(0); } else { modifyView->tics = args[1]; + + for (i = 0; i <= r_splitscreen; i++) + { + if (displayplayers[i] == (mo->player - players)) + { + R_ResetViewInterpolation(i + 1); + } + } } if (args[2] != 0) @@ -3067,7 +3078,6 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha case TMCAM_THIRD: { mobj_t *firstPlace = NULL; - INT32 i; for (i = 0; i < MAXPLAYERS; i++) { @@ -3125,6 +3135,28 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha break; } } + + // If target is valid, then we'll focus on it. + // See also MT_ALTVIEWMAN mobjthinker + if (newViewMobj->target != NULL && P_MobjWasRemoved(newViewMobj->target) == false) + { + newViewMobj->angle = R_PointToAngle2( + newViewMobj->x, + newViewMobj->y, + newViewMobj->target->x, + newViewMobj->target->y + ); + + newViewMobj->pitch = R_PointToAngle2( + 0, + newViewMobj->z, + R_PointToDist2( + newViewMobj->x, newViewMobj->y, + newViewMobj->target->x, newViewMobj->target->y + ), + newViewMobj->target->z + (newViewMobj->target->height >> 1) + ); + } } else {