mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Fixed linting
This commit is contained in:
parent
a842299969
commit
9453d60707
2 changed files with 19 additions and 17 deletions
|
|
@ -136,13 +136,12 @@ export default class ClassSheet extends DHBaseItemSheet {
|
|||
);
|
||||
}
|
||||
|
||||
if (item.system.classIdentifiers.includes(this.document.system.identifier))
|
||||
return;
|
||||
if (item.system.classIdentifiers.includes(this.document.system.identifier)) return;
|
||||
|
||||
await item.update({ 'system.classIdentifiers': [...item.system.classIdentifiers, this.document.system.identifier] });
|
||||
}
|
||||
|
||||
else if (['feature', 'ActiveEffect'].includes(itemType)) {
|
||||
await item.update({
|
||||
'system.classIdentifiers': [...item.system.classIdentifiers, this.document.system.identifier]
|
||||
});
|
||||
} else if (['feature', 'ActiveEffect'].includes(itemType)) {
|
||||
super._onDrop(event);
|
||||
} else if (this.document.parent?.type !== 'character') {
|
||||
if (itemType === 'weapon') {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ export default class DHClass extends BaseDataItem {
|
|||
isMulticlass: new fields.BooleanField({ initial: false }),
|
||||
identifier: new fields.StringField(),
|
||||
/* Subclasses is legacy. If we can safetely migrate it away at some point we could remove it*/
|
||||
subclasses: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false }),
|
||||
subclasses: new ForeignDocumentUUIDArrayField({ type: 'Item', required: false })
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -76,14 +76,17 @@ export default class DHClass extends BaseDataItem {
|
|||
const oldLinkedSubclasses = this.subclasses.filter(x => x);
|
||||
if (!this.identifier) return oldLinkedSubclasses;
|
||||
|
||||
const subclasses = game.items.filter(x => x.type === 'subclass' && x.system.classIdentifiers.includes(this.identifier));
|
||||
const subclasses = game.items.filter(
|
||||
x => x.type === 'subclass' && x.system.classIdentifiers.includes(this.identifier)
|
||||
);
|
||||
for (const pack of game.packs) {
|
||||
const indexes = await pack.getIndex({ fields: ['system.classIdentifiers'] });
|
||||
for (const index of indexes) {
|
||||
if (
|
||||
index.type === 'subclass' &&
|
||||
(index.system.classIdentifiers??[]).includes(this.identifier &&
|
||||
!subclasses.find(x => x.uuid === index.uuid))
|
||||
(index.system.classIdentifiers ?? []).includes(
|
||||
this.identifier && !subclasses.find(x => x.uuid === index.uuid)
|
||||
)
|
||||
) {
|
||||
const subclass = await foundry.utils.fromUuid(index.uuid);
|
||||
subclasses.push(subclass);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue