mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Fixed effects not being creatable when not on an actor
This commit is contained in:
parent
d7ce388cad
commit
d79c236cfe
1 changed files with 32 additions and 28 deletions
|
|
@ -108,6 +108,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
update.img = 'icons/magic/life/heart-cross-blue.webp';
|
update.img = 'icons/magic/life/heart-cross-blue.webp';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.actor) {
|
||||||
const existingEffect = this.actor.effects.find(x => x.origin === data.origin);
|
const existingEffect = this.actor.effects.find(x => x.origin === data.origin);
|
||||||
const stacks = Boolean(data.system?.stacking);
|
const stacks = Boolean(data.system?.stacking);
|
||||||
if (existingEffect && !stacks) return false;
|
if (existingEffect && !stacks) return false;
|
||||||
|
|
@ -119,7 +120,9 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.parent) {
|
||||||
const statuses = Object.keys(data.statuses ?? {});
|
const statuses = Object.keys(data.statuses ?? {});
|
||||||
const immuneStatuses =
|
const immuneStatuses =
|
||||||
statuses.filter(
|
statuses.filter(
|
||||||
|
|
@ -141,6 +144,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
this.parent.queueScrollText(scrollingTexts);
|
this.parent.queueScrollText(scrollingTexts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (Object.keys(update).length > 0) {
|
if (Object.keys(update).length > 0) {
|
||||||
await this.updateSource(update);
|
await this.updateSource(update);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue