PathGraph, skip closed cells early.
In path finding GetConnections considers connections to already closed cells and calculates the cost for them. The caller afterwards ignores them. These are 15% of all connections.
This commit is contained in:
@@ -72,10 +72,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return pos + new WVec(0, 0, height[cell] - pos.Z);
|
||||
}
|
||||
|
||||
bool ValidTransitionCell(CPos cell, LocomotorInfo li)
|
||||
bool ValidTransitionCell(CPos cell, SubterraneanLocomotorInfo sli)
|
||||
{
|
||||
var terrainType = map.GetTerrainInfo(cell).Type;
|
||||
var sli = (SubterraneanLocomotorInfo)li;
|
||||
if (!sli.SubterraneanTransitionTerrainTypes.Contains(terrainType) && sli.SubterraneanTransitionTerrainTypes.Any())
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user