diff --git a/src/module/sheets/TwodsixItemSheet.ts b/src/module/sheets/TwodsixItemSheet.ts index b70a7a384..5d6928786 100644 --- a/src/module/sheets/TwodsixItemSheet.ts +++ b/src/module/sheets/TwodsixItemSheet.ts @@ -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(); + } } }