From b3aa2520bcd4c72898ef5a0b57ef43e4128f4cd6 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 10 Mar 2023 22:43:06 +0000 Subject: [PATCH] gamedata->everseenspecial Record whether you've ever successfully entered a special stage Used for conditions which were previously checking for whether you'd completed a special stage - which I think is a bit too restrictive for someone figuring out what next to lab --- src/g_game.c | 12 +++++++++++- src/m_cond.c | 3 ++- src/m_cond.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 4b36b1f2c..72e396d1f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3926,6 +3926,13 @@ static void G_GetNextMap(void) grandprixinfo.eventmode = GPEVENT_SPECIAL; nextmap = cupLevelNum; newgametype = G_GuessGametypeByTOL(mapheaderinfo[cupLevelNum]->typeoflevel); + + if (gamedata->everseenspecial == false) + { + gamedata->everseenspecial = true; + M_UpdateUnlockablesAndExtraEmblems(true); + G_SaveGameData(true); + } } } } @@ -4583,6 +4590,7 @@ void G_LoadGameData(void) gamedata->everloadedaddon = (boolean)READUINT8(save.p); gamedata->eversavedreplay = (boolean)READUINT8(save.p); + gamedata->everseenspecial = (boolean)READUINT8(save.p); } else { @@ -4796,7 +4804,8 @@ void G_SaveGameData(boolean dirty) length = (4+1+4+4+ (4*GDGT_MAX)+ 4+1+1+1+1+ - 1+1+1+4+ + 1+1+1+1+ + 4+ (MAXEMBLEMS+(MAXUNLOCKABLES*2)+MAXCONDITIONSETS)+ 4+2); @@ -4846,6 +4855,7 @@ void G_SaveGameData(boolean dirty) WRITEUINT8(save.p, gamedata->everloadedaddon); // 1 WRITEUINT8(save.p, gamedata->eversavedreplay); // 1 + WRITEUINT8(save.p, gamedata->everseenspecial); // 1 WRITEUINT32(save.p, quickncasehash(timeattackfolder, 64)); diff --git a/src/m_cond.c b/src/m_cond.c index 6ea8e37e0..84c0472f6 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -527,6 +527,7 @@ void M_ClearStats(void) gamedata->everloadedaddon = false; gamedata->eversavedreplay = false; + gamedata->everseenspecial = false; gamedata->crashflags = 0; } @@ -1139,7 +1140,7 @@ static const char *M_GetConditionString(condition_t *cn) case UCRP_PREFIX_BREAKTHECAPSULES: return "BREAK THE CAPSULES:"; case UCRP_PREFIX_SEALEDSTAR: - if (gamedata->roundsplayed[GDGT_SPECIAL] == 0) + if (!gamedata->everseenspecial) return NULL; return "SEALED STARS:"; diff --git a/src/m_cond.h b/src/m_cond.h index 47bc45488..693a285e3 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -270,6 +270,7 @@ struct gamedata_t // SPECIFIC SPECIAL EVENTS boolean everloadedaddon; boolean eversavedreplay; + boolean everseenspecial; UINT8 crashflags; };