when loading a game, the gamestate is now erased...
...when the load_game_exception is caught, as opposed to before it is thrown. fixes bug #14460
This commit is contained in:
parent
a6af80df1c
commit
816b0fd75f
2 changed files with 11 additions and 8 deletions
|
@ -355,10 +355,14 @@ LEVEL_RESULT playsingle_controller::play_scenario(
|
|||
save = true;
|
||||
} //end for loop
|
||||
|
||||
} catch(game::load_game_exception&) {
|
||||
} catch(game::load_game_exception& lge) {
|
||||
// Loading a new game is effectively a quit.
|
||||
//
|
||||
if (lge.game != "") {
|
||||
gamestate_ = game_state();
|
||||
}
|
||||
log.quit(turn());
|
||||
throw;
|
||||
throw lge;
|
||||
} catch (end_level_exception &end_level_exn) {
|
||||
ai_testing::log_game_end();
|
||||
LEVEL_RESULT end_level_result = end_level_exn.result;
|
||||
|
@ -713,10 +717,13 @@ void playsingle_controller::linger(upload_log& log)
|
|||
play_slice();
|
||||
gui_->draw();
|
||||
}
|
||||
} catch(game::load_game_exception&) {
|
||||
} catch(game::load_game_exception& lge) {
|
||||
// Loading a new game is effectively a quit.
|
||||
if (lge.game != "") {
|
||||
gamestate_ = game_state();
|
||||
}
|
||||
log.quit(turn());
|
||||
throw;
|
||||
throw lge;
|
||||
}
|
||||
|
||||
// revert the end-turn button text to its normal label
|
||||
|
|
|
@ -399,7 +399,6 @@ void loadgame::show_dialog(bool show_replay, bool cancel_orders)
|
|||
filename_ = load_dialog.filename();
|
||||
show_replay_ = load_dialog.show_replay();
|
||||
cancel_orders_ = load_dialog.cancel_orders();
|
||||
gamestate_ = game_state();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -409,9 +408,6 @@ void loadgame::show_dialog(bool show_replay, bool cancel_orders)
|
|||
filename_ = dialogs::load_game_dialog(gui_, game_config_, &show_replay_dialog, &cancel_orders_dialog);
|
||||
show_replay_ = show_replay_dialog;
|
||||
cancel_orders_ = cancel_orders_dialog;
|
||||
|
||||
if (filename_ != "")
|
||||
gamestate_ = game_state();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue