Skip to content

Commit

Permalink
fix(web): quick quest load was broken after save refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Aug 31, 2023
1 parent 01e6922 commit 2b5a128
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/zc/title.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ static bool register_name()
bool cancel=false;

if (!load_qstpath.empty()) {
new_game->header.qstpath = load_qstpath;

std::string filename = get_filename(load_qstpath.c_str());
filename.erase(remove(filename.begin(), filename.end(), ' '), filename.end());
auto len = filename.find(".qst", 0);
Expand Down Expand Up @@ -1196,8 +1198,7 @@ static void select_game(bool skip = false)
saves_select(saves_count() - 1);
loadlast = saves_current_selection() + 1;
strcpy(qstpath, load_qstpath.c_str());
chosecustomquest = true;
load_custom_game(saves_count() - 1);
saves_do_first_time_stuff(saves_current_selection());
saves_write();
break;
}
Expand Down Expand Up @@ -1430,7 +1431,6 @@ void titlescreen(int32_t lsave)
if (saves_get_slot(slot)->header->quest)
{
saves_select(slot);
select_game();
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/zc/zelda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5251,8 +5251,13 @@ int main(int argc, char **argv)

if (qstpath_to_load == save->header->qstpath)
{
save_index = i;
break;
if (save_index == -1)
save_index = i;
else
{
save_index = -1;
break;
}
}
}

Expand Down

0 comments on commit 2b5a128

Please sign in to comment.