mail[Wesnoth-commits] r33195 - /trunk/src/actions.cpp


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

Header


Content

Posted by alinktomine on March 01, 2009 - 04:13:
Author: alink
Date: Sun Mar  1 04:13:53 2009
New Revision: 33195

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33195&view=rev
Log:
Clear the undo stack for some very rare cases
(failed teleport and super-hidden unit)

Modified:
    trunk/src/actions.cpp

Modified: trunk/src/actions.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/actions.cpp?rev=33195&r1=33194&r2=33195&view=diff
==============================================================================
--- trunk/src/actions.cpp (original)
+++ trunk/src/actions.cpp Sun Mar  1 04:13:53 2009
@@ -2216,10 +2216,13 @@
                const unit_map::const_iterator enemy_unit = units.find(*step);
                if (enemy_unit != units.end()) {
                        if (team.is_enemy(enemy_unit->second.side())) {
-                               break; // can't traverse enemy
+                               // can't traverse enemy (bug in fog or 
pathfinding?)
+                               should_clear_stack = true; // assuming that 
this enemy was hidden somehow
+                               break; 
                        } else if (!tiles_adjacent(*(step-1),*step)) {
                                // can't teleport on ally (on fogged village, 
with no-leader and view not-shared)
                                teleport_failed = true;
+                               should_clear_stack = true; // we have info 
not supposed to be shared
                                break;
                        }
                }
@@ -2369,14 +2372,12 @@
                for (sight_it = seen_units.begin();
                                sight_it != seen_units.end(); ++sight_it)
                {
-
                        
game_events::raise(sighted_str,*sight_it,steps.back());
                }
 
                for (sight_it = stoned_units.begin();
                                sight_it != stoned_units.end(); ++sight_it)
                {
-
                        
game_events::raise(sighted_str,*sight_it,steps.back());
                }
        }




Related Messages


Powered by MHonArc, Updated Sun Mar 01 04:20:05 2009