Skip to content

Commit

Permalink
Fixed history record disabling in shape generator
Browse files Browse the repository at this point in the history
  • Loading branch information
SIsilicon committed Nov 26, 2024
1 parent 34c8322 commit d4275a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/shapes/base_shape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export abstract class Shape {
let blocksAffected = 0;
const blocksAndChunks: (Block | [Vector3, Vector3])[] = [];

const history = options?.recordHistory ?? true ? session.getHistory() : null;
const history = options?.recordHistory ?? true ? session.getHistory() : undefined;
const record = history?.record(this.usedInBrush);
try {
let count = 0;
Expand Down Expand Up @@ -238,7 +238,7 @@ export abstract class Shape {

progress = 0;
yield Jobs.nextStep("Generating blocks...");
yield* history?.addUndoStructure(record, min, max);
if (history) yield* history.addUndoStructure(record, min, max);
for (let block of blocksAndChunks) {
if (block instanceof Block) {
if (!block.isValid() && Jobs.inContext()) block = yield* Jobs.loadBlock(loc);
Expand All @@ -254,7 +254,7 @@ export abstract class Shape {
progress += volume;
}
}
yield* history?.addRedoStructure(record, min, max);
if (history) yield* history.addRedoStructure(record, min, max);
}
history?.commit(record);
return count;
Expand Down

0 comments on commit d4275a4

Please sign in to comment.