mail[Wesnoth-commits] r29118 - in /trunk: changelog players_changelog src/playmp_controller.cpp


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

Header


Content

Posted by paniemin on August 30, 2008 - 17:29:
Author: suokko
Date: Sat Aug 30 17:29:15 2008
New Revision: 29118

URL: http://svn.gna.org/viewcvs/wesnoth?rev=29118&view=rev
Log:
Fixed OOS bug when giving control and having move in undo stack.

Modified:
    trunk/changelog
    trunk/players_changelog
    trunk/src/playmp_controller.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=29118&r1=29117&r2=29118&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Sat Aug 30 17:29:15 2008
@@ -44,6 +44,7 @@
    * Made config cache code available to eveverywhere in wesnoth
    * Fixed [modify_turns] giving the unwanted side-effect of changing
      turn limit when only current= modifier was used.
+   * Fixed OOS bug when giving control and having move in undo stack.
    * Fixed [modify_turns] not updating $turn_number when current= was
      used.
    * Fixed a few inconsistencies related to scenarios which are not at

Modified: trunk/players_changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/players_changelog?rev=29118&r1=29117&r2=29118&view=diff
==============================================================================
--- trunk/players_changelog (original)
+++ trunk/players_changelog Sat Aug 30 17:29:15 2008
@@ -22,6 +22,9 @@
   * User interface:
     * Parts of the new widget libary are deemed stable enough for testing and
       have been started to replace the old code.
+
+  * Bug fixes:
+    * Fixed OOS bug when giving control and having move in undo stack.
 
 Version 1.5.3:
   * Campaigns

Modified: trunk/src/playmp_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playmp_controller.cpp?rev=29118&r1=29117&r2=29118&view=diff
==============================================================================
--- trunk/src/playmp_controller.cpp (original)
+++ trunk/src/playmp_controller.cpp Sat Aug 30 17:29:15 2008
@@ -22,6 +22,8 @@
 #include "playturn.hpp"
 #include "sound.hpp"
 #include "upload_log.hpp"
+
+#include "SDL.h"
 
 #include <cassert>
 
@@ -186,6 +188,21 @@
                                try{
                                        if 
(turn_data_->process_network_data(cfg,res,backlog,skip_replay_) == 
turn_info::PROCESS_RESTART_TURN)
                                        {
+                                               // Clean undo stack if turn 
has to be restarted (losing control)
+                                               if (!undo_stack_.empty())
+                                               {
+                                                       const std::string msg 
=_("Undoing moves not yet transmited to server.");
+                                                       const int size = 20;
+                                                       const int lifetime = 
150;
+                                                       SDL_Color colour = 
{255,255,255,255};
+
+                                                       SDL_Rect rect = 
gui_->map_area();
+                                                       
font::add_floating_label(msg,size, colour,
+                                                               
rect.w/2,rect.h/2,0.0,0.0,lifetime,rect,font::CENTER_ALIGN);
+                                               }
+
+                                               while(!undo_stack_.empty())
+                                                       
menu_handler_.undo(gui_->get_playing_team() + 1);
                                                throw 
end_turn_exception(gui_->get_playing_team() + 1);
                                        }
                                }




Related Messages


Powered by MHonArc, Updated Sat Aug 30 18:01:40 2008