Merge pull request #10702 from RoosterDragon/map-contains-fix

Fix Map.Contains for maps with height
This commit is contained in:
Matthias Mailänder
2016-02-06 23:02:56 +01:00
2 changed files with 9 additions and 6 deletions

View File

@@ -768,7 +768,12 @@ namespace OpenRA
if (Grid.MaximumTerrainHeight == 0)
return Contains((PPos)uv);
foreach (var puv in ProjectedCellsCovering(uv))
// If the cell has no valid projection, then we're off the map.
var projectedCells = ProjectedCellsCovering(uv);
if (projectedCells.Length == 0)
return false;
foreach (var puv in projectedCells)
if (!Contains(puv))
return false;
return true;