wesnoth-cvs-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Wesnoth-cvs-commits] wesnoth/src actions.cpp


From: Guillaume Melquiond
Subject: [Wesnoth-cvs-commits] wesnoth/src actions.cpp
Date: Sat, 09 Apr 2005 18:22:19 -0400

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Guillaume Melquiond <address@hidden>    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 <address@hidden>
    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

[Prev in Thread] Current Thread [Next in Thread]