Fix Map.Contains checks for maps with height.
If a cell lacked any valid projected cells, then it is off the map entirely. The previous logic would think such a cell was within the map as none of projected cells were out of bounds (as there were no projected cells to fail the check).
This commit is contained in:
@@ -771,7 +771,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;
|
||||
|
||||
Reference in New Issue
Block a user