diff --git a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs index 1d7bea0809..b8bf47194e 100644 --- a/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs +++ b/OpenRA.Mods.Common/EditorBrushes/EditorTileBrush.cs @@ -136,21 +136,22 @@ namespace OpenRA.Mods.Common.Widgets return; var queue = new Queue(); - var touched = new bool[map.MapSize.X, map.MapSize.Y]; + var touched = new CellLayer(map); var rules = map.Rules; var tileset = rules.TileSets[map.Tileset]; var template = tileset.Templates[Template]; - Action maybeEnqueue = (newCell) => + Action maybeEnqueue = newCell => { - if (map.Contains(cell) && !touched[newCell.X, newCell.Y]) + if (map.Contains(cell) && !touched[newCell]) { queue.Enqueue(newCell); - touched[newCell.X, newCell.Y] = true; + touched[newCell] = true; } }; - Func shouldPaint = (cellToCheck) => + + Func shouldPaint = cellToCheck => { for (var y = 0; y < template.Size.Y; y++) {