Nullable fix in baseAction.getEffects

This commit is contained in:
WBHarry 2026-01-16 10:16:01 +01:00
parent d626285a88
commit 325a48532b
2 changed files with 3 additions and 3 deletions

View file

@ -274,13 +274,13 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
*/
static async getEffects(actor, effectParent) {
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;
if (effectParent?.type !== 'weapon' || effectParent?.system.secondary) return false;
} else if (effectParent?.id !== effect.parent.id) return false;
}