CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <[EMAIL PROTECTED]> 05/04/09 22:22:19

Modified files:
        src            : actions.cpp 

Log message:
        Fix bug #9649 by giving back movement points when allied units are 
blocking the way.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/actions.cpp.diff?tr1=1.203&tr2=1.204&r1=text&r2=text

Patches:
Index: wesnoth/src/actions.cpp
diff -u wesnoth/src/actions.cpp:1.203 wesnoth/src/actions.cpp:1.204
--- wesnoth/src/actions.cpp:1.203       Tue Mar 29 17:41:08 2005
+++ wesnoth/src/actions.cpp     Sat Apr  9 22:22:19 2005
@@ -1,4 +1,4 @@
-/* $Id: actions.cpp,v 1.203 2005/03/29 17:41:08 darthfool Exp $ */
+/* $Id: actions.cpp,v 1.204 2005/04/09 22:22:19 silene Exp $ */
 /*
    Copyright (C) 2003 by David White <[EMAIL PROTECTED]>
    Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -1691,7 +1691,11 @@
        std::vector<gamemap::location>::const_iterator begin = route.begin();
 
        std::vector<gamemap::location> steps(begin,step);
-       while(!steps.empty() && units.count(steps.back()) != 0) {
+       while (!steps.empty()) {
+               gamemap::location const &loc = steps.back();
+               if (units.count(loc) == 0)
+                       break;
+               moves_left += u.movement_cost(map, map[loc.x][loc.y]);
                steps.pop_back();
        }
 


Reply via email to