mail[Wesnoth-commits] r37255 - in /trunk/src: playsingle_controller.cpp playsingle_controller.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by AI0867 on July 27, 2009 - 04:28:
Author: ai0867
Date: Mon Jul 27 04:28:47 2009
New Revision: 37255

URL: http://svn.gna.org/viewcvs/wesnoth?rev=37255&view=rev
Log:
Make [end_turn] work in new turn, side turn and turn refresh [event]s again.

Modified:
    trunk/src/playsingle_controller.cpp
    trunk/src/playsingle_controller.hpp

Modified: trunk/src/playsingle_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playsingle_controller.cpp?rev=37255&r1=37254&r2=37255&view=diff
==============================================================================
--- trunk/src/playsingle_controller.cpp (original)
+++ trunk/src/playsingle_controller.cpp Mon Jul 27 04:28:47 2009
@@ -130,6 +130,11 @@
        }
 }
 
+void playsingle_controller::force_end_turn(){
+       skip_next_turn_ = true;
+       end_turn_ = true;
+}
+
 void playsingle_controller::rename_unit(){
        menu_handler_.rename_unit(mouse_handler_);
 }
@@ -503,10 +508,6 @@
                // If a side is empty skip over it.
                if (current_team().is_empty()) continue;
                try {
-                       if (skip_next_turn_) {
-                               skip_next_turn_ = false;
-                               throw end_turn_exception();
-                       }
                        save_blocker blocker;
                        init_side(player_number_ - 1);
                } catch (end_turn_exception) {
@@ -571,7 +572,8 @@
                // it has to be a class member since derived classes
                // rely on it
                player_type_changed_ = false;
-               end_turn_ = false;
+               if (!skip_next_turn_)
+                       end_turn_ = false;
 
 
                statistics::reset_turn_stats(teams_[team_index - 
1].save_id());
@@ -620,6 +622,7 @@
        } while (player_type_changed_);
        // Keep looping if the type of a team (human/ai/networked)
        // has changed mid-turn
+       skip_next_turn_ = false;
 }
 
 void playsingle_controller::before_human_turn(bool save)

Modified: trunk/src/playsingle_controller.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playsingle_controller.hpp?rev=37255&r1=37254&r2=37255&view=diff
==============================================================================
--- trunk/src/playsingle_controller.hpp (original)
+++ trunk/src/playsingle_controller.hpp Mon Jul 27 04:28:47 2009
@@ -45,7 +45,7 @@
        virtual void toggle_shroud_updates();
        virtual void update_shroud_now();
        virtual void end_turn();
-       virtual void force_end_turn(){ end_turn_ = true; }
+       virtual void force_end_turn();
        virtual void rename_unit();
        virtual void create_unit();
        virtual void change_side();




Related Messages


Powered by MHonArc, Updated Mon Jul 27 05:01:30 2009