Distinguish between all map cells and cells inside map bounds.

This commit is contained in:
Paul Chote
2015-05-30 14:33:01 +01:00
parent 6650e3d9c7
commit bf4722fb9f
8 changed files with 38 additions and 26 deletions

View File

@@ -82,7 +82,7 @@ namespace OpenRA.Mods.Common.Widgets
actorSprite = new Sprite(radarSheet, new Rectangle(0, height, width, height), TextureChannel.Alpha);
// Set initial terrain data
foreach (var cell in world.Map.Cells)
foreach (var cell in world.Map.CellsInsideBounds)
UpdateTerrainCell(cell);
world.Map.MapTiles.Value.CellEntryChanged += UpdateTerrainCell;
@@ -91,6 +91,9 @@ namespace OpenRA.Mods.Common.Widgets
void UpdateTerrainCell(CPos cell)
{
if (!world.Map.Contains(cell))
return;
var stride = radarSheet.Size.Width;
var uv = cell.ToMPos(world.Map);