Skip to content

Commit

Permalink
fix(zc): load default quest for sfx when loading replay
Browse files Browse the repository at this point in the history
Quests before custom sfx rely on the default quest providing sfx,
but that wasn't being loaded when playing back a replay. So it would
either use whatever the last quest loaded, or have nothing, which was
the case for the replay test script.
  • Loading branch information
connorjclark committed Feb 11, 2024
1 parent 8d15352 commit 4bc56ae
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/zc/zelda.cpp
Expand Up @@ -4041,6 +4041,10 @@ static void load_replay_file(ReplayMode mode, std::string replay_file, int frame

if (strlen(zc_get_config("zeldadx", "replay_snapshot", "")) > 0)
replay_add_snapshot_frame(zc_get_config("zeldadx", "replay_snapshot", ""));

// Older quests don't have a misc section, and QMisc isn't set by default except via loading the default quest.
// So do that here, since not all code paths to this will have done it already.
init_NES_mode();
}

static bool load_replay_file_deffered_called = false;
Expand Down
4 changes: 2 additions & 2 deletions tests/replays/demons_inferno/demons_inferno_1_of_2.zplay
Git LFS file not shown
4 changes: 2 additions & 2 deletions tests/replays/demons_inferno/demons_inferno_2_of_2.zplay
Git LFS file not shown
4 changes: 2 additions & 2 deletions tests/replays/grassland_attack.zplay
Git LFS file not shown
4 changes: 2 additions & 2 deletions tests/replays/hell_awaits/hell_awaits_1_of_2.zplay
Git LFS file not shown
4 changes: 2 additions & 2 deletions tests/replays/hell_awaits/hell_awaits_2_of_2.zplay
Git LFS file not shown
2 changes: 2 additions & 0 deletions tests/run_replay_tests.py
Expand Up @@ -264,6 +264,8 @@ def on_created(self, event):
mode = 'assert'
if args.update:
mode = 'update'
if args.frame:
args.headless = False
elif args.replay:
mode = 'replay'
else:
Expand Down

0 comments on commit 4bc56ae

Please sign in to comment.