From 7e699a43241d1c52a632ff783b06c12f12efc33b Mon Sep 17 00:00:00 2001 From: Matt Penny Date: Sun, 14 Jan 2024 00:09:40 -0500 Subject: [PATCH] Dynamically get level count for all levels cheat --- src/menu/cheat_codes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/menu/cheat_codes.c b/src/menu/cheat_codes.c index cdecd92..9ef2db1 100644 --- a/src/menu/cheat_codes.c +++ b/src/menu/cheat_codes.c @@ -5,6 +5,7 @@ #include "../scene/scene.h" #include "../build/src/audio/clips.h" #include "../savefile/savefile.h" +#include "../levels/levels.h" struct CheatCodePattern gCheatCodes[CheatCodeCount] = { [CheatCodeUnlockGun] = { @@ -46,7 +47,7 @@ void cheatCodeApply(enum CheatCode cheat) { playerToggleInvincibility(&gScene.player); break; case CheatCodeAllLevels: - savefileMarkChapterProgress(7); + savefileMarkChapterProgress(levelCount() - 1); break; case CheatCodeCount: break;