mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
[Fix] ItemLink Fix (#1032)
* . * . * Removed outcommented code * Raised to minor version * Added confirmation on import of old character data
This commit is contained in:
parent
218f180fa0
commit
523ecb506b
14 changed files with 122 additions and 81 deletions
|
|
@ -591,7 +591,6 @@ export default function DHApplicationMixin(Base) {
|
|||
if (featureOnCharacter) {
|
||||
systemData = {
|
||||
originItemType: this.document.type,
|
||||
originId: this.document.id,
|
||||
identifier: this.document.system.isMulticlass ? 'multiclass' : null
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,12 +149,12 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) {
|
|||
const { type } = target.dataset;
|
||||
const cls = foundry.documents.Item.implementation;
|
||||
|
||||
const multiclass = this.document.system.isMulticlass ? 'multiclass' : null;
|
||||
let systemData = {};
|
||||
if (this.document.parent?.type === 'character') {
|
||||
systemData = {
|
||||
originItemType: this.document.type,
|
||||
originId: this.document.id,
|
||||
identifier: this.document.system.isMulticlass ? 'multiclass' : null
|
||||
identifier: multiclass ?? type
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -275,14 +275,15 @@ export default class DHBaseItemSheet extends DHApplicationMixin(ItemSheetV2) {
|
|||
|
||||
if (this.document.parent?.type === 'character') {
|
||||
const itemData = item.toObject();
|
||||
const multiclass = this.document.system.isMulticlass ? 'multiclass' : null;
|
||||
item = await cls.create(
|
||||
{
|
||||
...itemData,
|
||||
_stats: { compendiumSource: this.document.uuid },
|
||||
system: {
|
||||
...itemData.system,
|
||||
originItemType: this.document.type,
|
||||
originId: this.document.id,
|
||||
identifier: this.document.system.isMulticlass ? 'multiclass' : null
|
||||
identifier: multiclass ?? target.dataset.type
|
||||
}
|
||||
},
|
||||
{ parent: this.document.parent }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue