From dc4c596fa0dc844fc1d8e17082e56038d0edf5e3 Mon Sep 17 00:00:00 2001 From: Ashley Newson Date: Wed, 15 Jan 2025 22:57:47 +0000 Subject: [PATCH] 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.) --- OpenRA.Mods.Common/Traits/World/RaMapGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/World/RaMapGenerator.cs b/OpenRA.Mods.Common/Traits/World/RaMapGenerator.cs index 86b5b5e868..f9d237e82f 100644 --- a/OpenRA.Mods.Common/Traits/World/RaMapGenerator.cs +++ b/OpenRA.Mods.Common/Traits/World/RaMapGenerator.cs @@ -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); }