Changed the harvester heuristic so that now takes into account the distance from the initial search location. This makes harvesters somewhat more "intelligent" and gather nearer resources. Also solved several regressions introduced in the recent changes in the Pathfinder
This commit is contained in:
@@ -60,7 +60,6 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
return null;
|
||||
}
|
||||
|
||||
cached.Tick = world.WorldTick;
|
||||
return cached.Result;
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,13 @@ namespace OpenRA.Mods.Common.Pathfinder
|
||||
var currentCell = Graph[currentMinNode];
|
||||
Graph[currentMinNode] = new CellInfo(currentCell.CostSoFar, currentCell.EstimatedTotal, currentCell.PreviousPos, CellStatus.Closed);
|
||||
|
||||
if (Graph.CustomCost != null)
|
||||
{
|
||||
var c = Graph.CustomCost(currentMinNode);
|
||||
if (c == int.MaxValue)
|
||||
return currentMinNode;
|
||||
}
|
||||
|
||||
foreach (var connection in Graph.GetConnections(currentMinNode))
|
||||
{
|
||||
// Calculate the cost up to that point
|
||||
|
||||
Reference in New Issue
Block a user