Dynamically get level count for all levels cheat

This commit is contained in:
Matt Penny 2024-01-14 00:09:40 -05:00
parent bf482724bc
commit 7e699a4324

View File

@ -5,6 +5,7 @@
#include "../scene/scene.h" #include "../scene/scene.h"
#include "../build/src/audio/clips.h" #include "../build/src/audio/clips.h"
#include "../savefile/savefile.h" #include "../savefile/savefile.h"
#include "../levels/levels.h"
struct CheatCodePattern gCheatCodes[CheatCodeCount] = { struct CheatCodePattern gCheatCodes[CheatCodeCount] = {
[CheatCodeUnlockGun] = { [CheatCodeUnlockGun] = {
@ -46,7 +47,7 @@ void cheatCodeApply(enum CheatCode cheat) {
playerToggleInvincibility(&gScene.player); playerToggleInvincibility(&gScene.player);
break; break;
case CheatCodeAllLevels: case CheatCodeAllLevels:
savefileMarkChapterProgress(7); savefileMarkChapterProgress(levelCount() - 1);
break; break;
case CheatCodeCount: case CheatCodeCount:
break; break;