don't ask the user twice about old version when loading a save

The issue only affected saves loaded from the in-game menu.
This commit is contained in:
Chris Beck 2014-12-14 22:45:07 -05:00
parent 5a7f2becf0
commit 615d4024ce
5 changed files with 15 additions and 5 deletions

View File

@ -19,3 +19,4 @@ bool game::load_game_exception::show_replay;
bool game::load_game_exception::cancel_orders;
bool game::load_game_exception::select_difficulty;
std::string game::load_game_exception::difficulty;
bool game::load_game_exception::skip_version_check;

View File

@ -74,7 +74,8 @@ public:
, const bool show_replay_
, const bool cancel_orders_
, const bool select_difficulty_
, const std::string& difficulty_)
, const std::string& difficulty_
, bool skip_version_check_ = false)
: tlua_jailbreak_exception()
{
game = game_;
@ -82,6 +83,7 @@ public:
cancel_orders = cancel_orders_;
select_difficulty = select_difficulty_;
difficulty = difficulty_;
skip_version_check = skip_version_check_;
}
static std::string game;
@ -89,6 +91,7 @@ public:
static bool cancel_orders;
static bool select_difficulty;
static std::string difficulty;
static bool skip_version_check;
private:

View File

@ -652,7 +652,7 @@ bool game_launcher::load_game()
state_);
try {
if(!load.load_game(game::load_game_exception::game, game::load_game_exception::show_replay, game::load_game_exception::cancel_orders, game::load_game_exception::select_difficulty, game::load_game_exception::difficulty)) {
if(!load.load_game(game::load_game_exception::game, game::load_game_exception::show_replay, game::load_game_exception::cancel_orders, game::load_game_exception::select_difficulty, game::load_game_exception::difficulty, game::load_game_exception::skip_version_check)) {
clear_loaded_game();
return false;
}

View File

@ -197,7 +197,7 @@ bool loadgame::load_game()
return false;
}
throw game::load_game_exception(filename_, show_replay_, cancel_orders_, select_difficulty_, difficulty_);
throw game::load_game_exception(filename_, show_replay_, cancel_orders_, select_difficulty_, difficulty_, true);
}
bool loadgame::load_game(
@ -205,7 +205,8 @@ bool loadgame::load_game(
, const bool show_replay
, const bool cancel_orders
, const bool select_difficulty
, const std::string& difficulty)
, const std::string& difficulty
, bool skip_version_check)
{
filename_ = filename;
difficulty_ = difficulty;
@ -256,6 +257,10 @@ bool loadgame::load_game(
gamestate_.classification() = game_classification(load_config_);
#endif
if (skip_version_check) {
return true;
}
return check_version_compatibility();
}

View File

@ -50,7 +50,8 @@ public:
, const bool show_replay
, const bool cancel_orders
, const bool select_difficulty
, const std::string& difficulty);
, const std::string& difficulty
, bool skip_version_check);
/** Loading a game from within the multiplayer-create dialog. */
bool load_multiplayer_game();
/** Generate the gamestate out of the loaded game config. */