Skip to content

Commit

Permalink
fix(zc): handle error when sav file fails to load
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Sep 2, 2023
1 parent 7e3dd39 commit b6ca752
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/zc/saves.cpp
Expand Up @@ -1684,14 +1684,15 @@ static int load_from_save_file(ReadMode read_mode, fs::path filename, std::vecto
{
out_saves.clear();

system_pal();
enter_sys_pal();
char buf[256];
snprintf(buf, 256, "Couldn't open %s", filenameCStr);
jwin_alert("Can't Open Saved Game File",
buf,
error,
"",
"OK",NULL,'o',0,get_zc_font(font_lfont));
exit_sys_pal();
}

return ret;
Expand Down
13 changes: 7 additions & 6 deletions src/zc/title.cpp
Expand Up @@ -1258,12 +1258,13 @@ static void select_game(bool skip = false)
{
case 0:
// TODO: this is being called too much!
saves_select(saveslot);
loadlast = saves_current_selection() + 1;

if (saves_get_slot(saveslot)->header->quest)
done=true;

if (saves_select(saveslot))
{
loadlast = saves_current_selection() + 1;
if (saves_get_slot(saveslot)->header->quest)
done=true;
}

break;

case 2:
Expand Down

0 comments on commit b6ca752

Please sign in to comment.