Ensure LaysTerrain doesn't access cells outside the map.

This commit is contained in:
RoosterDragon
2015-12-13 16:16:40 +00:00
parent 62addb9c60
commit 0f70e23b70

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.D2k.Traits
foreach (var c in FootprintUtils.Tiles(self))
{
// Only place on allowed terrain types
if (!info.TerrainTypes.Contains(map.GetTerrainInfo(c).Type))
if (!map.Contains(c) || !info.TerrainTypes.Contains(map.GetTerrainInfo(c).Type))
continue;
// Don't place under other buildings or custom terrain