Author: boucman
Date: Sat Apr 30 13:28:30 2011
New Revision: 49335

URL: http://svn.gna.org/viewcvs/wesnoth?rev=49335&view=rev
Log:
backport r45510 patch by {V}

Modified:
    branches/1.8/changelog
    branches/1.8/src/play_controller.cpp
    branches/1.8/src/play_controller.hpp
    branches/1.8/src/playsingle_controller.cpp

Modified: branches/1.8/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/changelog?rev=49335&r1=49334&r2=49335&view=diff
==============================================================================
--- branches/1.8/changelog (original)
+++ branches/1.8/changelog Sat Apr 30 13:28:30 2011
@@ -14,6 +14,8 @@
      skipping to the lobby with -s <server> command line.
  * Miscellaneous and bug fixes:
    * Fixed: properly update cmake revision numbers (bug #16483)
+   * Backport r45510: fixes a crash triggered by WML code changing the
+     objectives after end of scenario conditions were already reached.
 
 Version 1.8.5:
  * AI:

Modified: branches/1.8/src/play_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/play_controller.cpp?rev=49335&r1=49334&r2=49335&view=diff
==============================================================================
--- branches/1.8/src/play_controller.cpp (original)
+++ branches/1.8/src/play_controller.cpp Sat Apr 30 13:28:30 2011
@@ -867,14 +867,6 @@
        soundsources_manager_->update();
 }
 
-void play_controller::slice_end() {
-       if(!browse_ && teams_[gui_->viewing_team()].objectives_changed()) {
-               check_end_level();
-               dialogs::show_objectives(level_, 
teams_[gui_->viewing_team()].objectives());
-               teams_[gui_->viewing_team()].reset_objectives_changed();
-       }
-}
-
 events::mouse_handler& play_controller::get_mouse_handler_base() {
        return mouse_handler_;
 }

Modified: branches/1.8/src/play_controller.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/play_controller.hpp?rev=49335&r1=49334&r2=49335&view=diff
==============================================================================
--- branches/1.8/src/play_controller.hpp (original)
+++ branches/1.8/src/play_controller.hpp Sat Apr 30 13:28:30 2011
@@ -143,7 +143,6 @@
        bool is_skipping_replay() const { return skip_replay_;};
 protected:
        void slice_before_scroll();
-       void slice_end();
 
        events::mouse_handler& get_mouse_handler_base();
        game_display& get_display();

Modified: branches/1.8/src/playsingle_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.8/src/playsingle_controller.cpp?rev=49335&r1=49334&r2=49335&view=diff
==============================================================================
--- branches/1.8/src/playsingle_controller.cpp (original)
+++ branches/1.8/src/playsingle_controller.cpp Sat Apr 30 13:28:30 2011
@@ -25,6 +25,7 @@
 #include "ai/manager.hpp"
 #include "ai/game_info.hpp"
 #include "ai/testing.hpp"
+#include "dialogs.hpp"
 #include "foreach.hpp"
 #include "game_end_exceptions.hpp"
 #include "game_events.hpp"
@@ -139,7 +140,14 @@
 void playsingle_controller::check_end_level()
 {
        if ((level_result_ == NONE) || linger_)
+       {
+               team &t = teams_[gui_->viewing_team()];
+               if (!browse_ && t.objectives_changed()) {
+                       dialogs::show_objectives(level_, t.objectives());
+                       t.reset_objectives_changed();
+               }
                return;
+       }
        throw end_level_exception(level_result_);
 }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to