From ba5dc49d30d6ba465b01dbf3abc933250edcb6c6 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 13 Feb 2005 02:36:41 +0000 Subject: Fix in calculating G cost in A* implementation. --- src/map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index 597afa49..1e4cb3ba 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -263,7 +263,7 @@ PATH_NODE *Map::findPath(int startX, int startY, int destX, int destY) // Calculate G cost for this route, 10 for moving straight and // 14 for moving diagonal - int Gcost = curr.tile->Gcost + (dx == 0 || dy == 0) ? 10 : 14; + int Gcost = curr.tile->Gcost + ((dx == 0 || dy == 0) ? 10 : 14); if (newTile->whichList != onOpenList) { -- cgit v1.2.3-70-g09d2