Fix a crash in AIUtils

This commit is contained in:
abcdefg30
2020-10-10 12:30:39 +02:00
committed by reaperrr
parent f67b7ad837
commit 6dcb701d1d

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common
return cells.Select(a => map.FindTilesInCircle(a.Location, radius) return cells.Select(a => map.FindTilesInCircle(a.Location, radius)
.Count(c => map.Contains(c) && terrainTypes.Contains(map.GetTerrainInfo(c).Type) && .Count(c => map.Contains(c) && terrainTypes.Contains(map.GetTerrainInfo(c).Type) &&
Util.AdjacentCells(world, Target.FromCell(world, c)) Util.AdjacentCells(world, Target.FromCell(world, c))
.All(ac => terrainTypes.Contains(map.GetTerrainInfo(ac).Type)))) .All(ac => map.Contains(ac) && terrainTypes.Contains(map.GetTerrainInfo(ac).Type))))
.Any(availableCells => availableCells > 0); .Any(availableCells => availableCells > 0);
} }