fixed minor compiler issues in linux for new pathfinder changes
This commit is contained in:
parent
20165b4566
commit
9992f9cb79
|
@ -409,7 +409,8 @@ float ClusterMap::aStarPathLength(Field f, int size, const Vec2i &start, const V
|
||||||
DiagonalDistance dd(dest);
|
DiagonalDistance dd(dest);
|
||||||
se->setNodeLimit(GameConstants::clusterSize * GameConstants::clusterSize);
|
se->setNodeLimit(GameConstants::clusterSize * GameConstants::clusterSize);
|
||||||
se->setStart(start, dd(start));
|
se->setStart(start, dd(start));
|
||||||
AStarResult res = se->aStar<PosGoal,MoveCost,DiagonalDistance>(PosGoal(dest), costFunc, dd);
|
PosGoal goal(dest);
|
||||||
|
AStarResult res = se->aStar<PosGoal,MoveCost,DiagonalDistance>(goal, costFunc, dd);
|
||||||
Vec2i goalPos = se->getGoalPos();
|
Vec2i goalPos = se->getGoalPos();
|
||||||
if (res != asrComplete || goalPos != dest) {
|
if (res != asrComplete || goalPos != dest) {
|
||||||
return -1.f;
|
return -1.f;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// ==============================================================
|
// ==============================================================
|
||||||
// This file is part of Glest (www.glest.org)
|
// This file is part of Glest (www.glest.org)
|
||||||
//
|
//
|
||||||
// Copyright (C) 2001-2008 Martiño Figueroa
|
// Copyright (C) 2001-2008 Martio Figueroa
|
||||||
// 2009-2010 James McCulloch
|
// 2009-2010 James McCulloch
|
||||||
//
|
//
|
||||||
// You can redistribute this code and/or modify it under
|
// You can redistribute this code and/or modify it under
|
||||||
|
@ -201,7 +201,8 @@ float RoutePlanner::quickSearch(Field field, int size, const Vec2i &start, const
|
||||||
DiagonalDistance heuristic(dest);
|
DiagonalDistance heuristic(dest);
|
||||||
nsgSearchEngine->setStart(start, heuristic(start));
|
nsgSearchEngine->setStart(start, heuristic(start));
|
||||||
|
|
||||||
AStarResult r = nsgSearchEngine->aStar(PosGoal(dest), moveCost, heuristic);
|
PosGoal goal(dest);
|
||||||
|
AStarResult r = nsgSearchEngine->aStar(goal, moveCost, heuristic);
|
||||||
if (r == asrComplete && nsgSearchEngine->getGoalPos() == dest) {
|
if (r == asrComplete && nsgSearchEngine->getGoalPos() == dest) {
|
||||||
return nsgSearchEngine->getCostTo(dest);
|
return nsgSearchEngine->getCostTo(dest);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user