Skip Bonus Rounds when loading up Live Event Backups

Prevents the exploit Tape discussed from being used for Battle.
Also attempts to recover to Podium if relevant.
This commit is contained in:
toaster 2023-06-25 20:23:44 +01:00
parent 3474fd6e83
commit 87c26f0fe9
4 changed files with 50 additions and 11 deletions

View file

@ -4145,7 +4145,7 @@ void G_GPCupIntoRoundQueue(cupheader_t *cup, UINT8 setgametype, boolean setencor
}
}
static void G_GetNextMap(void)
void G_GetNextMap(void)
{
INT32 i;
boolean setalready = false;

View file

@ -206,6 +206,7 @@ boolean G_GametypeHasSpectators(void);
INT16 G_SometimesGetDifferentEncore(void);
void G_ExitLevel(void);
void G_NextLevel(void);
void G_GetNextMap(void);
void G_Continue(void);
void G_UseContinue(void);
void G_AfterIntermission(void);

View file

@ -35,6 +35,7 @@
#include "y_inter.h"
#include "m_cond.h"
#include "p_local.h"
#include "p_saveg.h"
#include "p_setup.h"
#include "st_stuff.h" // hud hiding
#include "fastcmp.h"
@ -252,6 +253,12 @@ boolean K_StartCeremony(void)
maptol = mapheaderinfo[gamemap-1]->typeoflevel;
globalweather = mapheaderinfo[gamemap-1]->weather;
if (savedata.lives > 0)
{
K_LoadGrandPrixSaveGame();
savedata.lives = 0;
}
// Make sure all of the GAME OVER'd players can spawn
// and be present for the podium
for (i = 0; i < MAXPLAYERS; i++)

View file

@ -5,6 +5,7 @@
#include "../r_skins.h"
#include "../s_sound.h"
#include "../k_grandprix.h" // K_CanChangeRules
#include "../k_podium.h" // K_StartCeremony
#include "../m_cond.h" // Condition Sets
#include "../r_local.h" // SplitScreen_OnChange
#include "../m_misc.h" // FIL_FileExists
@ -530,19 +531,49 @@ static void M_GPBackup(INT32 choice)
SplitScreen_OnChange();
}
const UINT8 entry = roundqueue.position-1;
UINT8 entry = roundqueue.position-1;
SV_StartSinglePlayerServer(roundqueue.entries[entry].gametype, false);
D_MapChange(
roundqueue.entries[entry].mapnum + 1,
roundqueue.entries[entry].gametype,
roundqueue.entries[entry].encore,
true,
1,
false,
roundqueue.entries[entry].rankrestricted
);
// Skip Bonus rounds.
if (roundqueue.entries[entry].gametype != roundqueue.entries[0].gametype
&& roundqueue.entries[entry].rankrestricted == false)
{
G_GetNextMap(); // updates position in the roundqueue
entry = roundqueue.position-1;
}
if (entry < roundqueue.size)
{
D_MapChange(
roundqueue.entries[entry].mapnum + 1,
roundqueue.entries[entry].gametype,
roundqueue.entries[entry].encore,
true,
1,
false,
roundqueue.entries[entry].rankrestricted
);
}
else
{
if (K_StartCeremony() == false)
{
// Accomodate our buffoonery with the artificial fade.
wipegamestate = -1;
M_StartMessage(
"Grand Prix Backup",
"The session is concluded!\n"
"You exited a final Bonus Round,\n"
"and the Podium failed to load.\n",
NULL, MM_NOTHING, NULL, NULL);
G_HandleSaveLevel(true);
return;
}
}
M_ClearMenus(true);