mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 15:03:37 +02:00
Fixed ActiveEffect preCreate blocking multiple effects with origin=null
This commit is contained in:
parent
d79c236cfe
commit
7f8e3fee6e
1 changed files with 1 additions and 16 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { itemAbleRollParse } from '../helpers/utils.mjs';
|
||||
import { RefreshType } from '../systemRegistration/socket.mjs';
|
||||
|
||||
export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||
/* -------------------------------------------- */
|
||||
|
|
@ -108,7 +107,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
|||
update.img = 'icons/magic/life/heart-cross-blue.webp';
|
||||
}
|
||||
|
||||
if (this.actor) {
|
||||
if (this.actor && data.origin) {
|
||||
const existingEffect = this.actor.effects.find(x => x.origin === data.origin);
|
||||
const stacks = Boolean(data.system?.stacking);
|
||||
if (existingEffect && !stacks) return false;
|
||||
|
|
@ -153,20 +152,6 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
|||
await super._preCreate(data, options, user);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
_onCreate(data, options, userId) {
|
||||
super._onCreate(data, options, userId);
|
||||
|
||||
Hooks.callAll(RefreshType.EffectsDisplay);
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
_onDelete(data, options, userId) {
|
||||
super._onDelete(data, options, userId);
|
||||
|
||||
Hooks.callAll(RefreshType.EffectsDisplay);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* Methods */
|
||||
/* -------------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue