Skip to content

Commit adca2b3

Browse files
committed
fix(zc): set previously unset save_t write_to_disk in all places
1 parent e8edc34 commit adca2b3

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/zc/saves.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,13 +2121,14 @@ bool saves_create_slot(gamedata* game, bool write_to_disk)
21212121
return true;
21222122
}
21232123

2124-
bool saves_create_slot(fs::path path)
2124+
bool saves_create_slot(fs::path path, bool write_to_disk)
21252125
{
21262126
if (!fs::exists(path))
21272127
return false;
21282128

21292129
auto& save = saves.emplace_back();
21302130
save.path = path;
2131+
save.write_to_disk = write_to_disk;
21312132
return true;
21322133
}
21332134

src/zc/saves.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace fs = std::filesystem;
1010
struct save_t
1111
{
1212
fs::path path;
13-
bool write_to_disk;
13+
bool write_to_disk = true;
1414
// If loaded is false, this is null.
1515
// If loaded is true and `game` is null, this memory is owned by save_t.
1616
// If loaded is true and `game` is not null, this points to the header field in `game`.
@@ -45,7 +45,7 @@ void saves_unselect();
4545
int32_t saves_count();
4646
int32_t saves_current_selection();
4747
bool saves_create_slot(gamedata* game, bool write_to_disk = true);
48-
bool saves_create_slot(fs::path path);
48+
bool saves_create_slot(fs::path path, bool write_to_disk = true);
4949
bool saves_is_slot_loaded(int32_t index, bool full_data = false);
5050
const save_t* saves_get_slot(int32_t index, bool full_data = false);
5151
const save_t* saves_get_current_slot();

src/zc/zelda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5141,7 +5141,7 @@ int main(int argc, char **argv)
51415141
if (replay_is_active() && replay_get_meta_str("sav").size())
51425142
{
51435143
auto save_path = replay_get_replay_path().parent_path() / replay_get_meta_str("sav");
5144-
bool success = saves_create_slot(save_path);
5144+
bool success = saves_create_slot(save_path, false);
51455145
if (!success)
51465146
Z_error_fatal("Failed to load replay's save file");
51475147
}

0 commit comments

Comments
 (0)