From 03254fdb1e0b6620863072edc93e3fedf634bd02 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Sat, 31 May 2014 20:43:30 -0400 Subject: [PATCH 1/2] use completion setter object in mp linger mode mp linger mode was not properly setting the completion status, as sp does. This caused mp end of scenario saves not to end up in linger mode when they are reloaded. Note that this reopens bug 15545 (!) https://gna.org/bugs/index.php?15545 In 1.11+, I believe that the correct way to fix that is to save the [carryover] while in linger mode, and restore it on reload, however this is for another commit... --- src/playmp_controller.cpp | 2 +- src/playsingle_controller.cpp | 14 -------------- src/playsingle_controller.hpp | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/playmp_controller.cpp b/src/playmp_controller.cpp index 0c85344c401c..a71e25d6201f 100644 --- a/src/playmp_controller.cpp +++ b/src/playmp_controller.cpp @@ -311,7 +311,7 @@ void playmp_controller::linger() // this is actually for after linger mode is over -- we don't want to // stay stuck in linger state when the *next* scenario is over. - gamestate_.classification().completion = "running"; + set_completion setter(gamestate_,"running"); // End all unit moves BOOST_FOREACH(unit &u, units_) { u.set_user_end_turn(true); diff --git a/src/playsingle_controller.cpp b/src/playsingle_controller.cpp index 10acc669604b..ed9223255850 100644 --- a/src/playsingle_controller.cpp +++ b/src/playsingle_controller.cpp @@ -811,20 +811,6 @@ void playsingle_controller::play_human_turn() { gui_->draw(); } } -struct set_completion -{ - set_completion(game_state& state, const std::string& completion) : - state_(state), completion_(completion) - { - } - ~set_completion() - { - state_.classification().completion = completion_; - } - private: - game_state& state_; - const std::string completion_; -}; void playsingle_controller::linger() { diff --git a/src/playsingle_controller.hpp b/src/playsingle_controller.hpp index 09df87f006e4..573c8b9bb3ae 100644 --- a/src/playsingle_controller.hpp +++ b/src/playsingle_controller.hpp @@ -21,6 +21,21 @@ #include "playturn.hpp" #include "replay.hpp" +struct set_completion +{ + set_completion(game_state& state, const std::string& completion) : + state_(state), completion_(completion) + { + } + ~set_completion() + { + state_.classification().completion = completion_; + } + private: + game_state& state_; + const std::string completion_; +}; + class playsingle_controller : public play_controller { public: From 7828466e1a400c433812b7aa60620de6cfcf019a Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Sat, 31 May 2014 21:53:21 -0400 Subject: [PATCH 2/2] update changelog --- changelog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/changelog b/changelog index 99aa1ef9d629..95aa9e0b6c5d 100644 --- a/changelog +++ b/changelog @@ -211,6 +211,11 @@ Version 1.11.11: * Linux dbus notifications: Only last 5 messages are remembered, and they are displayed with the most recent ones first. * Fixed bug #21736: MP create screen always defaulting to top entry. + * Fix bug #21397: "Saving and loading may cause a side's turn is not + initialized". + * Fix bug which caused no units to be displayed when reloading an end of + scenario save, by stripping them from the save file. However, this does + not fix bug #15545, which was the reason that this behavior was introduced. Version 1.11.10: * Add-ons client: