From f1eb35a31937fdf224a969488c1a7a5e195a8f61 Mon Sep 17 00:00:00 2001 From: Rampastring Date: Wed, 18 Dec 2024 21:59:46 +0200 Subject: [PATCH] Fix Redo not working for FlattenGroundMutation --- .../Classes/HeightMutations/AlterElevationMutationBase.cs | 8 ++++++++ .../Classes/HeightMutations/FlattenGroundMutation.cs | 2 ++ 2 files changed, 10 insertions(+) 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;