diff --git a/src/TSMapEditor/Mutations/Classes/HeightMutations/AlterElevationMutationBase.cs b/src/TSMapEditor/Mutations/Classes/HeightMutations/AlterElevationMutationBase.cs index d84884fb..3851ceb3 100644 --- a/src/TSMapEditor/Mutations/Classes/HeightMutations/AlterElevationMutationBase.cs +++ b/src/TSMapEditor/Mutations/Classes/HeightMutations/AlterElevationMutationBase.cs @@ -33,6 +33,14 @@ protected bool IsCellMorphable(MapTile cell) return Map.TheaterInstance.Theater.TileSets[Map.TheaterInstance.GetTileSetId(cell.TileIndex)].Morphable; } + protected void Clear() + { + cellsToProcess.Clear(); + processedCellsThisIteration.Clear(); + totalProcessedCells.Clear(); + undoData.Clear(); + } + /// /// Adds a cell's data to the undo data structure. /// Does nothing if the cell has already been added to the undo data structure. diff --git a/src/TSMapEditor/Mutations/Classes/HeightMutations/FlattenGroundMutation.cs b/src/TSMapEditor/Mutations/Classes/HeightMutations/FlattenGroundMutation.cs index 88f144d6..1311ca2f 100644 --- a/src/TSMapEditor/Mutations/Classes/HeightMutations/FlattenGroundMutation.cs +++ b/src/TSMapEditor/Mutations/Classes/HeightMutations/FlattenGroundMutation.cs @@ -29,6 +29,8 @@ public FlattenGroundMutation(IMutationTarget mutationTarget, Point2D originCell, private void FlattenGround() { + Clear(); + int xSize = BrushSize.Width; int ySize = BrushSize.Height;