Skip to content

Commit 28da5a0

Browse files
committed
Add Auto-LAT support to terrain line painting
1 parent 426d47c commit 28da5a0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/TSMapEditor/Mutations/Classes/PlaceTerrainLineMutation.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ private void PlaceTile(Point2D coords)
146146
undoData.Add(new OriginalCellTerrainData(cellCoords, cell.TileIndex, cell.SubTileIndex, cell.Level));
147147
cell.ChangeTileIndex(tile.TileID, (byte)i);
148148
cell.Level = (byte)Math.Min(cell.Level + tile.GetSubTile(i).TmpImage.Height, Constants.MaxMapHeightLevel);
149+
150+
if (MutationTarget.AutoLATEnabled)
151+
{
152+
BrushSize brush1x1 = Map.EditorConfig.BrushSizes.Find(static bs => bs.Width == 1 && bs.Height == 1);
153+
if (brush1x1 == null)
154+
throw new InvalidOperationException($"{nameof(PlaceTerrainLineMutation)}.{nameof(PlaceTile)}: Unable to find 1x1 brush!");
155+
156+
ApplyAutoLATForTilePlacement(tile, brush1x1, cellCoords);
157+
}
149158
}
150159
}
151160

0 commit comments

Comments
 (0)