Skip to content

Commit

Permalink
Fix Redo not working for FlattenGroundMutation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Dec 18, 2024
1 parent d619907 commit f1eb35a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/// <summary>
/// Adds a cell's data to the undo data structure.
/// Does nothing if the cell has already been added to the undo data structure.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public FlattenGroundMutation(IMutationTarget mutationTarget, Point2D originCell,

private void FlattenGround()
{
Clear();

int xSize = BrushSize.Width;
int ySize = BrushSize.Height;

Expand Down

0 comments on commit f1eb35a

Please sign in to comment.