Skip to content

Commit

Permalink
Fixed overlay and erosion brushes not undoing
Browse files Browse the repository at this point in the history
  • Loading branch information
SIsilicon committed Dec 18, 2024
1 parent f6c5fae commit fbfd7b2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/server/modules/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export interface BlockChanges {
setBlock(loc: Vector3, block: BlockPermutation): void;

applyIteration(): void;
flush(): Generator<number>;
flush(): Generator<any>;
}

class BlockChangeImpl implements BlockChanges {
Expand Down Expand Up @@ -356,9 +356,7 @@ class BlockChangeImpl implements BlockChanges {

*flush() {
this.applyIteration();
for (const range of this.ranges) {
this.history.addUndoStructure(this.record, ...range);
}
for (const range of this.ranges) yield* this.history.addUndoStructure(this.record, ...range);

let i = 0;
for (const [loc, block] of this.changes.entries()) {
Expand All @@ -370,9 +368,7 @@ class BlockChangeImpl implements BlockChanges {
yield ++i;
}

for (const range of this.ranges) {
this.history.addRedoStructure(this.record, ...range);
}
for (const range of this.ranges) yield* this.history.addRedoStructure(this.record, ...range);
this.ranges.length = 0;
this.changes.clear();
}
Expand Down

0 comments on commit fbfd7b2

Please sign in to comment.