Directly check the map bounds instead of converting to PPos
This commit is contained in:
@@ -810,8 +810,9 @@ namespace OpenRA
|
|||||||
|
|
||||||
bool ContainsAllProjectedCellsCovering(MPos uv)
|
bool ContainsAllProjectedCellsCovering(MPos uv)
|
||||||
{
|
{
|
||||||
|
// PERF: Checking the bounds directly here is the same as calling Contains((PPos)uv) but saves an allocation
|
||||||
if (Grid.MaximumTerrainHeight == 0)
|
if (Grid.MaximumTerrainHeight == 0)
|
||||||
return Contains((PPos)uv);
|
return Bounds.Contains(uv.U, uv.V);
|
||||||
|
|
||||||
// If the cell has no valid projection, then we're off the map.
|
// If the cell has no valid projection, then we're off the map.
|
||||||
var projectedCells = ProjectedCellsCovering(uv);
|
var projectedCells = ProjectedCellsCovering(uv);
|
||||||
|
|||||||
Reference in New Issue
Block a user