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

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

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


From: Jon Daniel
Subject: [Wesnoth-cvs-commits] wesnoth/src pathfind.cpp
Date: Sun, 23 Jan 2005 09:31:06 -0500

CVSROOT:        /cvsroot/wesnoth
Module name:    wesnoth
Branch:         
Changes by:     Jon Daniel <address@hidden>     05/01/23 14:31:06

Modified files:
        src            : pathfind.cpp 

Log message:
        factored the new if a bit

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

Patches:
Index: wesnoth/src/pathfind.cpp
diff -u wesnoth/src/pathfind.cpp:1.56 wesnoth/src/pathfind.cpp:1.57
--- wesnoth/src/pathfind.cpp:1.56       Sun Jan 23 14:25:34 2005
+++ wesnoth/src/pathfind.cpp    Sun Jan 23 14:31:06 2005
@@ -1,4 +1,4 @@
-/* $Id: pathfind.cpp,v 1.56 2005/01/23 14:25:34 j_daniel Exp $ */
+/* $Id: pathfind.cpp,v 1.57 2005/01/23 14:31:06 j_daniel Exp $ */
 /*
 Copyright (C) 2003 by David White <address@hidden>
 Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -629,13 +629,13 @@
 
        const int starting_movement = unit_.movement_left();
        int remaining_movement = starting_movement - current_cost;
-       int total = unit_.total_movement();
-       if (total != 0) {
-               if (remaining_movement < 0) {
-               remaining_movement = total - (-remaining_movement) % total;
+       if (remaining_movement < 0) {
+               int total = unit_.total_movement();
+               if (total != 0) {
+                       remaining_movement = total - (-remaining_movement) % 
total;
+               } else {
+                       remaining_movement = -remaining_movement;
                }
-       } else if (remaining_movement < 0) {
-               remaining_movement = -remaining_movement;
        }
 
        int additional_cost = base_cost > remaining_movement ? 
remaining_movement : 0;




reply via email to

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