From c5e4dd52cbefc72a8df36474040de77ea618386b Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Fri, 16 Jan 2026 07:38:01 +0100 Subject: [PATCH] Update module/data/action/baseAction.mjs Co-authored-by: Carlos Fernandez --- module/data/action/baseAction.mjs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/module/data/action/baseAction.mjs b/module/data/action/baseAction.mjs index 1fa14186..0addc6b3 100644 --- a/module/data/action/baseAction.mjs +++ b/module/data/action/baseAction.mjs @@ -273,20 +273,19 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel * @returns {DhActiveEffect[]} */ static async getEffects(actor, effectParent) { - if (actor) - return Array.from(await actor.allApplicableEffects()).filter(effect => { - /* Effects on weapons only ever apply for the weapon itself */ - if (effect.parent.type === 'weapon') { - /* Unless they're secondary - then they apply only to other primary weapons */ - if (effect.parent.system.secondary) { - if (effectParent.type !== 'weapon' || effectParent.system.secondary) return false; - } else if (effectParent?.id !== effect.parent.id) return false; - } + if (!actor) return []; + + return Array.from(await actor.allApplicableEffects()).filter(effect => { + /* Effects on weapons only ever apply for the weapon itself */ + if (effect.parent.type === 'weapon') { + /* Unless they're secondary - then they apply only to other primary weapons */ + if (effect.parent.system.secondary) { + if (effectParent.type !== 'weapon' || effectParent.system.secondary) return false; + } else if (effectParent?.id !== effect.parent.id) return false; + } - return !effect.isSuppressed; - }); - - return []; + return !effect.isSuppressed; + }); } /**