From 2c00019715188d1d07c27672ebfdb0412f9d7556 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 28 Jul 2015 20:58:39 +0100 Subject: [PATCH] Revert "Temporarily work around RadarWidget corruption." This reverts commit 4bc75f1ed68cc00ced92dc306512335d7da6b872. --- OpenRA.Game/Map/Map.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index a26d6fa4ee..d620aa3e7f 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -739,10 +739,10 @@ namespace OpenRA public bool Contains(MPos uv) { - // TODO: Checking against the bounds excludes valid parts of the map if MaxTerrainHeight > 0. - // Unfortunatley, doing this properly leads to memory corruption issues in the (unsafe) radar - // rendering code. - return Bounds.Contains(uv.U, uv.V) && ProjectedCellsCovering(uv).All(containsTest); + // The first check ensures that the cell is within the valid map region, avoiding + // potential crashes in deeper code. All CellLayers have the same geometry, and + // CustomTerrain is convenient (cellProjection may be null and others are Lazy). + return CustomTerrain.Contains(uv) && ProjectedCellsCovering(uv).All(containsTest); } public bool Contains(PPos puv)