fix dumb crash in minimap -- actors outside the map accessed memory that wasnt part of the bitmap.

This commit is contained in:
Chris Forbes
2010-07-26 22:16:23 +12:00
parent 56e929014d
commit 4cc021adfe

View File

@@ -123,8 +123,9 @@ namespace OpenRA.Graphics
foreach (var t in world.Queries.WithTraitMultiple<IRadarSignature>())
{
var color = t.Trait.RadarSignatureColor(t.Actor);
foreach( var cell in t.Trait.RadarSignatureCells(t.Actor))
*(c + ((cell.Y - world.Map.TopLeft.Y)* bitmapData.Stride >> 2) + cell.X - world.Map.TopLeft.X) = color.ToArgb();
foreach (var cell in t.Trait.RadarSignatureCells(t.Actor))
if (world.Map.IsInMap(cell))
*(c + ((cell.Y - world.Map.TopLeft.Y) * bitmapData.Stride >> 2) + cell.X - world.Map.TopLeft.X) = color.ToArgb();
}
}