Revert "Public roads: Dynamically set A* max search nodes"
This reverts commit acd67a0d0b
.
This commit is contained in:
@@ -947,6 +947,7 @@ static AyStar PublicRoadAyStar()
|
|||||||
finder.GetNeighbours = PublicRoad_GetNeighbours;
|
finder.GetNeighbours = PublicRoad_GetNeighbours;
|
||||||
finder.EndNodeCheck = PublicRoad_EndNodeCheck;
|
finder.EndNodeCheck = PublicRoad_EndNodeCheck;
|
||||||
finder.FoundEndNode = PublicRoad_FoundEndNode;
|
finder.FoundEndNode = PublicRoad_FoundEndNode;
|
||||||
|
finder.max_search_nodes = 1 << 20;
|
||||||
return finder;
|
return finder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -954,9 +955,6 @@ static bool PublicRoadFindPath(AyStar& finder, const TileIndex from, TileIndex t
|
|||||||
{
|
{
|
||||||
finder.user_target = reinterpret_cast<void *>(static_cast<uintptr_t>(to));
|
finder.user_target = reinterpret_cast<void *>(static_cast<uintptr_t>(to));
|
||||||
|
|
||||||
uint distance = DistanceManhattan(from, to);
|
|
||||||
finder.max_search_nodes = Clamp<uint32>(distance * distance * 64, 1 << 10, 1 << 20);
|
|
||||||
|
|
||||||
finder.Init(1 << _public_road_hash_size);
|
finder.Init(1 << _public_road_hash_size);
|
||||||
|
|
||||||
AyStarNode start {};
|
AyStarNode start {};
|
||||||
|
Reference in New Issue
Block a user