From fbfd7b2813386a83188e82436b6a0abbc3d5042d Mon Sep 17 00:00:00 2001 From: Roujel Williams Date: Wed, 18 Dec 2024 14:09:26 -0500 Subject: [PATCH] Fixed overlay and erosion brushes not undoing --- src/server/modules/history.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/server/modules/history.ts b/src/server/modules/history.ts index 6308efad6..d2992fe8a 100644 --- a/src/server/modules/history.ts +++ b/src/server/modules/history.ts @@ -284,7 +284,7 @@ export interface BlockChanges { setBlock(loc: Vector3, block: BlockPermutation): void; applyIteration(): void; - flush(): Generator; + flush(): Generator; } class BlockChangeImpl implements BlockChanges { @@ -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()) { @@ -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(); }