Skip to content

Free games for graphing calculators: NumWorks, TI-Nspire CX, Casio fx-CG50 and soon TI-84 Plus CE. Balatro, Celeste, Hollow Knight, Minecraft and more.

FNAF World: no erase question on an empty file

Mason3638da2cf196b56
diff --git a/games/fnafworld/src/game.c b/games/fnafworld/src/game.c
index a774a595..f963b7a5 100644
--- a/games/fnafworld/src/game.c
+++ b/games/fnafworld/src/game.c
@@ -101,7 +101,7 @@ static void files_step(void) {
if (!load_file(g.slot, &g.f)) memset(&g.f, 0, sizeof g.f);
break;
case 1:
- if (g.menu == 0) g.sub = 2, g.menu = 1;
+ if (g.menu == 0) g.sub = g.f.started ? 2 : 4, g.menu = g.f.started ? 1 : 0; /* (an empty file: nothing to erase) */
else if (g.f.started) start_play();
break;
case 2:
diff --git a/games/fnafworld/tests/rules.c b/games/fnafworld/tests/rules.c
index 2e568567..e8730bf1 100644
--- a/games/fnafworld/tests/rules.c
+++ b/games/fnafworld/tests/rules.c
@@ -29,7 +29,7 @@ static void new_game(int mode, int diff) {
tap(K_OK); /* the title */
tap(K_OK); /* file 1 */
tap(K_OK); /* new game */
- tap(K_UP), tap(K_OK); /* erase: yes */
+ if (g.sub == 2) tap(K_UP), tap(K_OK); /* erase: yes */
for (int i = 1; i < mode; i++) tap(K_DOWN);
tap(K_OK);
for (int i = 1; i < diff; i++) tap(K_DOWN);
diff --git a/tests/test_games.py b/tests/test_games.py
index 5fd8859f..35ba5eba 100644
--- a/tests/test_games.py
+++ b/tests/test_games.py
@@ -310,11 +310,11 @@ GAMES = {
# in it, paused
"fnaf4": ("FiveNightsAtFreddys4.nwa", "fnaf4res.sav", presses((1500, "ok"), (2200, "ok")), 9000,
presses((1500, "back")), 5000),
- # the title, file 1, New Game, yes, Adventure, Normal, the party (0 done), the map; Home keeps the file. Next time,
+ # the title, file 1, New Game, Adventure, Normal, the party (0 done), the map; Home keeps the file. Next time,
# from the copy: the title, file 1, Continue, the party, the map, quit with On/Off
"fnafworld": ("FiveNightsAtFreddysWorld.nwa", "fnafw1.sav",
- presses((1500, "ok"), (2200, "ok"), (2900, "ok"), (3600, "up"), (4100, "ok"), (4800, "ok"),
- (5500, "ok"), (6400, "0")) + [(7200, 9000, K["right"])], 11000,
+ presses((1500, "ok"), (2200, "ok"), (2900, "ok"), (3600, "ok"), (4300, "ok"),
+ (5200, "0")) + [(6000, 8000, K["right"])], 10000,
presses((1500, "ok"), (2200, "ok"), (2900, "down"), (3400, "ok"), (4100, "0"))
+ [(4800, 6400, K["left"])], 9000),
# how to play (the first time: two pages), Play, Stereo Madness, OK held to jump, Back to pause; Home keeps the