Handle Podium unlocks during mapload, not when finishing the ceremony

Solves mid-podium crashes not granting second page material
This commit is contained in:
toaster 2023-12-23 22:12:00 +00:00
parent d3af5db874
commit 64922460ac
3 changed files with 21 additions and 14 deletions

View file

@ -864,7 +864,11 @@ void K_InitializePodiumWaypoint(player_t *const player)
{ {
if ((player != NULL) && (player->mo != NULL)) if ((player != NULL) && (player->mo != NULL))
{ {
player->position = K_GetPodiumPosition(player); if (player->position == 0)
{
// Just in case a netgame scenario with a late joiner ocurrs.
player->position = K_GetPodiumPosition(player);
}
if (player->position > 0 && player->position <= MAXPLAYERS) if (player->position > 0 && player->position <= MAXPLAYERS)
{ {
@ -989,12 +993,6 @@ void K_FinishCeremony(void)
} }
g_podiumData.ranking = true; g_podiumData.ranking = true;
// Play the noise now (via G_UpdateVisited's concluding challenge check)
prevmap = gamemap-1;
G_UpdateVisited();
if (gamedata->deferredsave)
G_SaveGameData();
} }
/*-------------------------------------------------- /*--------------------------------------------------
@ -1084,8 +1082,11 @@ void K_ResetCeremony(void)
} }
} }
// Save before playing the noise // Update visitation.
G_SaveGameData(); prevmap = gamemap-1;
G_UpdateVisited();
// will subsequently save in P_LoadLevel
} }
/*-------------------------------------------------- /*--------------------------------------------------

View file

@ -1607,7 +1607,7 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
return (grandprixinfo.gamespeed >= cn->requirement); return (grandprixinfo.gamespeed >= cn->requirement);
case UCRP_PODIUMCUP: case UCRP_PODIUMCUP:
if (grandprixinfo.gp == false || K_PodiumRanking() == false) if (grandprixinfo.gp == false || K_PodiumSequence() == false)
return false; return false;
if (grandprixinfo.cup == NULL if (grandprixinfo.cup == NULL
|| ( || (
@ -1625,11 +1625,11 @@ boolean M_CheckCondition(condition_t *cn, player_t *player)
case UCRP_PODIUMEMERALD: case UCRP_PODIUMEMERALD:
case UCRP_PODIUMPRIZE: case UCRP_PODIUMPRIZE:
return (grandprixinfo.gp == true return (grandprixinfo.gp == true
&& K_PodiumRanking() == true && K_PodiumSequence() == true
&& grandprixinfo.rank.specialWon == true); && grandprixinfo.rank.specialWon == true);
case UCRP_PODIUMNOCONTINUES: case UCRP_PODIUMNOCONTINUES:
return (grandprixinfo.gp == true return (grandprixinfo.gp == true
&& K_PodiumRanking() == true && K_PodiumSequence() == true
&& grandprixinfo.rank.continuesUsed == 0); && grandprixinfo.rank.continuesUsed == 0);
case UCRP_FINISHCOOL: case UCRP_FINISHCOOL:
@ -2989,7 +2989,7 @@ boolean M_UpdateUnlockablesAndExtraEmblems(boolean loud, boolean doall)
} }
} }
if (!demo.playback && Playing() && (gamestate == GS_LEVEL || K_PodiumRanking() == true)) if (!demo.playback && Playing() && (gamestate == GS_LEVEL || K_PodiumSequence() == true))
{ {
for (i = 0; i <= splitscreen; i++) for (i = 0; i <= splitscreen; i++)
{ {

View file

@ -7600,7 +7600,13 @@ static void P_InitLevelSettings(void)
if (K_PodiumSequence() == true) if (K_PodiumSequence() == true)
{ {
; // NOP // Okay, now that everything preceding is handled, set the position.
for (i = 0; i < MAXPLAYERS; i++)
{
players[i].position = K_GetPodiumPosition(&players[i]);
}
// We don't touch the gamespeed, though!
} }
else if (grandprixinfo.gp == true) else if (grandprixinfo.gp == true)
{ {