mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Prevent class sheet and character errors when features/domains no longer exist (#1833)
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
Some checks are pending
Project CI / build (24.x) (push) Waiting to run
This commit is contained in:
parent
4a60c56462
commit
ccb0073cef
4 changed files with 5 additions and 3 deletions
|
|
@ -391,8 +391,9 @@ export default class DhCharacter extends DhCreature {
|
||||||
return this.domains.map(key => {
|
return this.domains.map(key => {
|
||||||
const domain = allDomainData[key];
|
const domain = allDomainData[key];
|
||||||
return {
|
return {
|
||||||
|
id: key,
|
||||||
...domain,
|
...domain,
|
||||||
label: game.i18n.localize(domain.label)
|
label: game.i18n.localize(domain?.label) ?? key
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export default class DhParty extends BaseDataActor {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
...super.defineSchema(),
|
...super.defineSchema(),
|
||||||
partyMembers: new ForeignDocumentUUIDArrayField({ type: 'Actor' }, { prune: true }),
|
partyMembers: new ForeignDocumentUUIDArrayField({ type: 'Actor' }),
|
||||||
notes: new fields.HTMLField(),
|
notes: new fields.HTMLField(),
|
||||||
gold: new GoldField(),
|
gold: new GoldField(),
|
||||||
tagTeam: new fields.EmbeddedDataField(TagTeamData),
|
tagTeam: new fields.EmbeddedDataField(TagTeamData),
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ export default class ForeignDocumentUUIDArrayField extends foundry.data.fields.A
|
||||||
*/
|
*/
|
||||||
constructor(fieldOption = {}, options = {}, context = {}) {
|
constructor(fieldOption = {}, options = {}, context = {}) {
|
||||||
super(new ForeignDocumentUUIDField(fieldOption), options, context);
|
super(new ForeignDocumentUUIDField(fieldOption), options, context);
|
||||||
|
this.options.prune ??= true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritdoc */
|
/** @inheritdoc */
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export default class DHScene extends foundry.abstract.DataModel {
|
||||||
close: new fields.NumberField({ integer: true, label: 'DAGGERHEART.CONFIG.Range.close.name' }),
|
close: new fields.NumberField({ integer: true, label: 'DAGGERHEART.CONFIG.Range.close.name' }),
|
||||||
far: new fields.NumberField({ integer: true, label: 'DAGGERHEART.CONFIG.Range.far.name' })
|
far: new fields.NumberField({ integer: true, label: 'DAGGERHEART.CONFIG.Range.far.name' })
|
||||||
}),
|
}),
|
||||||
sceneEnvironments: new ForeignDocumentUUIDArrayField({ type: 'Actor', prune: true })
|
sceneEnvironments: new ForeignDocumentUUIDArrayField({ type: 'Actor' })
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue