🐛 Fix Undo handling

This commit is contained in:
Andreas Schneider 2022-05-22 11:27:27 +02:00
parent dfef4d3556
commit 97c8270b38
1 changed files with 3 additions and 1 deletions

View File

@ -746,10 +746,10 @@ begin
if (not acSelect.Checked) and (targetTile <> nil) and (SelectedTile <> nil) then if (not acSelect.Checked) and (targetTile <> nil) and (SelectedTile <> nil) then
begin begin
targetRect := GetSelectedRect; targetRect := GetSelectedRect;
FUndoList.Clear;
if (SelectedTile = targetTile) or ConfirmAction then if (SelectedTile = targetTile) or ConfirmAction then
begin begin
FUndoList.Clear;
if acDraw.Checked then //***** Drawing Mode *****// if acDraw.Checked then //***** Drawing Mode *****//
begin begin
for tileX := FSelection.Left to FSelection.Right do for tileX := FSelection.Left to FSelection.Right do
@ -1217,7 +1217,9 @@ begin
dmNetwork.Send(FUndoList[i]); dmNetwork.Send(FUndoList[i]);
//Cleanup without freeing the objects (this was already done by dmNetwork.Send) //Cleanup without freeing the objects (this was already done by dmNetwork.Send)
FUndoList.FreeObjects := False;
FUndoList.Clear; FUndoList.Clear;
FUndoList.FreeObjects := True;
//No Undo packets, nothing to undo. //No Undo packets, nothing to undo.
acUndo.Enabled := False; acUndo.Enabled := False;