Fixed secondary weapons effects

This commit is contained in:
WBHarry 2026-01-15 23:53:41 +01:00
parent 841ddedd31
commit 32ffb26679

View file

@ -276,7 +276,13 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
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' && effectParent?.id !== effect.parent.id) return false;
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;
});