Fix a crash when building placements are moved out of the map.

This commit is contained in:
Matthias Mailänder
2021-10-09 10:16:00 +02:00
committed by abcdefg30
parent d88198e61e
commit 139af0c2bc

View File

@@ -104,7 +104,7 @@ namespace OpenRA.Mods.D2k.Traits
if ((c.Value & filter) == 0)
continue;
var isUnsafe = checkUnsafeTiles && candidateSafeTiles.Contains(c.Key) && info.UnsafeTerrainTypes.Contains(wr.World.Map.GetTerrainInfo(c.Key).Type);
var isUnsafe = checkUnsafeTiles && wr.World.Map.Contains(c.Key) && candidateSafeTiles.Contains(c.Key) && info.UnsafeTerrainTypes.Contains(wr.World.Map.GetTerrainInfo(c.Key).Type);
var tile = (c.Value & PlaceBuildingCellType.Invalid) != 0 ? blockedTile : isUnsafe ? unsafeTile : validTile;
var sequenceAlpha = (c.Value & PlaceBuildingCellType.Invalid) != 0 ? blockedAlpha : isUnsafe ? unsafeAlpha : validAlpha;