Fix an out-of-bounds CellLayer access in RaMapGenerator

Adds a bounds check for the water obstruction code, where a rotation
projection can be outside of the map area (on rotations other than
1, 2, or 4.)
This commit is contained in:
Ashley Newson
2025-01-15 22:57:47 +00:00
committed by Gustas
parent b9adbf8089
commit dc4c596fa0

View File

@@ -996,7 +996,7 @@ namespace OpenRA.Mods.Common.Traits
var projections = Symmetry.RotateAndMirrorCPos(
cpos, map.Tiles, param.Rotations, param.Mirror);
foreach (var projection in projections)
if (map.Tiles[projection].Type == param.WaterTile)
if (map.Tiles.Contains(projection) && map.Tiles[projection].Type == param.WaterTile)
unplayableWater.Add(projection);
}