Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feat-add-psi-abil…
Browse files Browse the repository at this point in the history
…ities
  • Loading branch information
marvin9257 committed Nov 5, 2024
2 parents 19c6be9 + b22b891 commit 34946db
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/module/sheets/TwodsixItemSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,19 @@ export class TwodsixItemSheet extends AbstractTwodsixItemSheet {
duplicateItem.system.priorType = this.item.type;
duplicateItem.system.type = newType;
duplicateItem.type = newType;
const newItem = await TwodsixItem.create(duplicateItem, {renderSheet: true, parent: this.item.parent});
const options = {renderSheet: true};
if (this.item.pack) {
options.pack = this.item.pack;
} else {
options.parent = this.item.parent;
}
const newItem = await TwodsixItem.create(duplicateItem, options);
if (newItem) {
this.item.delete();
if (this.item.pack) {
this.item.delete({pack: this.item.pack});
} else {
this.item.delete();
}
}
}

Expand Down

0 comments on commit 34946db

Please sign in to comment.