From e7b632332fe291bc2304d62cf262d9c7dcd9165e Mon Sep 17 00:00:00 2001 From: gfgtdf Date: Tue, 22 Jul 2014 02:00:20 +0200 Subject: [PATCH] partly revert e454252f2 there are multiple reasons why i think this should be reverted: 1) this wasn't tested enough, especialy we don't even know, whether all mainline campaigns are compatible (this can be easily fixed, but only if one know which campaigns are effected which requires testing) 2) after renaming remove_from_carryover_on_leaders_loss to remove_from_carryover_on_defeat it sounds wrong that this can result in removing units on victory. 3) this seemed to break many UMC addons. Note that this only removes one check for defeat_condition before [endlevel]. Especialy if for example side 1 gets defeated by defeat_condition in turn 1 but the game still goes on due to multiple other non defeated sides, but then the game ends with [endlevel] result=victory in turn 2, the units will be removed from carryover (unless specified otherwise) This was also the pre 1.11.13 behaviour. Also note that we cannot remove the 'defeated' side in case of [endlevel]result=victory, becasue [endlevel] doesn't sepcify which sides have victory/defeat. --- src/play_controller.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/play_controller.cpp b/src/play_controller.cpp index 6a7eebe6abe5..073255aec59b 100644 --- a/src/play_controller.cpp +++ b/src/play_controller.cpp @@ -1388,6 +1388,9 @@ void play_controller::check_victory() { return; } + + check_end_level(); + std::set not_defeated; for (unit_map::const_iterator i = units_.begin(), @@ -1430,8 +1433,6 @@ void play_controller::check_victory() } } - check_end_level(); - bool found_player = false; bool found_network_player = false;