Replace the Playground Hack with a specific fix via a case that needed its own function

This commit is contained in:
toaster 2025-07-24 19:36:24 +01:00
parent 998823db32
commit 43fef1a59b
6 changed files with 28 additions and 13 deletions

View file

@ -5130,7 +5130,7 @@ void G_EndGame(void)
return;
}
if (gametype == GT_TUTORIAL && M_GameTrulyStarted() && restoreMenu == NULL)
if (gametype == GT_TUTORIAL && M_GameAboutToStart() && restoreMenu == NULL)
{
// Playground Hack
F_StartIntro();

View file

@ -829,17 +829,10 @@ void M_StartControlPanel(void)
if (gamedata != NULL
&& gamedata->gonerlevel < GDGONER_OUTRO
&& gamestartchallenge < MAXUNLOCKABLES)
&& M_GameAboutToStart())
{
// See M_GameTrulyStarted
if (
gamedata->unlockpending[gamestartchallenge]
|| gamedata->unlocked[gamestartchallenge]
)
{
gamedata->gonerlevel = GDGONER_OUTRO;
M_GonerBGImplyPassageOfTime();
}
gamedata->gonerlevel = GDGONER_OUTRO;
M_GonerBGImplyPassageOfTime();
}
if (M_GameTrulyStarted() == false)

View file

@ -3475,6 +3475,27 @@ boolean M_GameTrulyStarted(void)
return (gamedata->gonerlevel == GDGONER_DONE);
}
boolean M_GameAboutToStart(void)
{
// Fail safe
if (gamedata == NULL)
return false;
// Not set
if (gamestartchallenge >= MAXUNLOCKABLES)
return true;
// An unfortunate sidestep, but sync is important.
if (netgame)
return true;
// Pending unlocked, but not unlocked
return (
gamedata->unlockpending[gamestartchallenge]
&& !gamedata->unlocked[gamestartchallenge]
);
}
boolean M_CheckNetUnlockByID(UINT16 unlockid)
{
if (unlockid >= MAXUNLOCKABLES

View file

@ -472,6 +472,7 @@ extern UINT16 gamestartchallenge;
boolean M_CheckNetUnlockByID(UINT16 unlockid);
boolean M_SecretUnlocked(INT32 type, boolean local);
boolean M_GameTrulyStarted(void);
boolean M_GameAboutToStart(void);
boolean M_CupLocked(cupheader_t *cup);
boolean M_CupSecondRowLocked(void);
boolean M_MapLocked(UINT16 mapnum);

View file

@ -101,7 +101,7 @@ void M_QuitSRB2(INT32 choice)
(void)choice;
if (M_GameTrulyStarted())
if (!M_GameAboutToStart() && M_GameTrulyStarted())
{
INT32 mrand = M_RandomKey(sizeof(quitsounds) / sizeof(INT32));
if (quitsounds[mrand])

View file

@ -562,7 +562,7 @@ void M_EndGame(INT32 choice)
return;
if (M_GameTrulyStarted() == false
|| (gametype == GT_TUTORIAL && restoreMenu == NULL)) // Playground Hack
|| M_GameAboutToStart() == true) // Playground Hack
{
// No returning to the title screen.
M_QuitSRB2(-1);