From 3aca89603b0e57875e303bbd7a0ba81ac272db3e Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 4 Jun 2023 16:24:46 +0100 Subject: [PATCH] M_ChallengesInputs: Debugging code for temporarily re-locking existing opened challenges is now more important than resetting the grid, because the grid can be reset via -resetchallengegrid command line param --- src/menus/extras-challenges.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/menus/extras-challenges.c b/src/menus/extras-challenges.c index eb49b762a..a61f0f58c 100644 --- a/src/menus/extras-challenges.c +++ b/src/menus/extras-challenges.c @@ -545,24 +545,16 @@ boolean M_ChallengesInputs(INT32 ch) { challengesmenu.unlockcount[CC_CHAONOPE] = 6; S_StartSound(NULL, sfx_s3k7b); //sfx_s3kb2 -#if 0 // debugging - if (challengesmenu.currentunlock < MAXUNLOCKABLES) - { - if (gamedata->unlocked[challengesmenu.currentunlock] && challengesmenu.unlockanim >= UNLOCKTIME) - { - if (challengesmenu.unlockcount[CC_TALLY] > 0) - challengesmenu.unlockcount[CC_TALLY]--; - else - challengesmenu.unlockcount[CC_UNLOCKED]--; - } - Z_Free(gamedata->challengegrid); - gamedata->challengegrid = NULL; - gamedata->challengegridwidth = 0; - M_PopulateChallengeGrid(); - M_UpdateChallengeGridExtraData(challengesmenu.extradata); - challengesmenu.pending = true; - M_ChallengesAutoFocus(challengesmenu.currentunlock, true); +#if 0 // debugging + if (challengesmenu.currentunlock < MAXUNLOCKABLES && challengesmenu.unlockanim >= UNLOCKTIME && gamedata->unlocked[challengesmenu.currentunlock] == true) + { + gamedata->unlocked[challengesmenu.currentunlock] = gamedata->unlockpending[challengesmenu.currentunlock] = false; + + if (challengesmenu.unlockcount[CC_TALLY] > 0) + challengesmenu.unlockcount[CC_TALLY]--; + else + challengesmenu.unlockcount[CC_UNLOCKED]--; } #endif }