From 615d4024ce0e9391e387025a4d3b0294e7fad63c Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Sun, 14 Dec 2014 22:45:07 -0500 Subject: [PATCH] don't ask the user twice about old version when loading a save The issue only affected saves loaded from the in-game menu. --- src/game_errors.cpp | 1 + src/game_errors.hpp | 5 ++++- src/game_launcher.cpp | 2 +- src/savegame.cpp | 9 +++++++-- src/savegame.hpp | 3 ++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/game_errors.cpp b/src/game_errors.cpp index 307939fa7ad..19964e0ae87 100644 --- a/src/game_errors.cpp +++ b/src/game_errors.cpp @@ -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; diff --git a/src/game_errors.hpp b/src/game_errors.hpp index 0269d96a776..bdcef8c26d4 100644 --- a/src/game_errors.hpp +++ b/src/game_errors.hpp @@ -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: diff --git a/src/game_launcher.cpp b/src/game_launcher.cpp index d71499f8e88..070db20a10f 100644 --- a/src/game_launcher.cpp +++ b/src/game_launcher.cpp @@ -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; } diff --git a/src/savegame.cpp b/src/savegame.cpp index 7c212c90746..d403760dd8b 100644 --- a/src/savegame.cpp +++ b/src/savegame.cpp @@ -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(); } diff --git a/src/savegame.hpp b/src/savegame.hpp index fba9e22eeda..19a46fa8706 100644 --- a/src/savegame.hpp +++ b/src/savegame.hpp @@ -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. */