mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-16 13:41:07 +01:00
Nullable fix in baseAction.getEffects
This commit is contained in:
parent
d626285a88
commit
325a48532b
2 changed files with 3 additions and 3 deletions
|
|
@ -274,13 +274,13 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
*/
|
*/
|
||||||
static async getEffects(actor, effectParent) {
|
static async getEffects(actor, effectParent) {
|
||||||
if (!actor) return [];
|
if (!actor) return [];
|
||||||
|
|
||||||
return Array.from(await actor.allApplicableEffects()).filter(effect => {
|
return Array.from(await actor.allApplicableEffects()).filter(effect => {
|
||||||
/* Effects on weapons only ever apply for the weapon itself */
|
/* Effects on weapons only ever apply for the weapon itself */
|
||||||
if (effect.parent.type === 'weapon') {
|
if (effect.parent.type === 'weapon') {
|
||||||
/* Unless they're secondary - then they apply only to other primary weapons */
|
/* Unless they're secondary - then they apply only to other primary weapons */
|
||||||
if (effect.parent.system.secondary) {
|
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;
|
} else if (effectParent?.id !== effect.parent.id) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "1.5.1",
|
"version": "1.5.2",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "13.346",
|
"minimum": "13.346",
|
||||||
"verified": "13.351",
|
"verified": "13.351",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue