From 82291b84c099f1c8cd2bba07775b42ed69905146 Mon Sep 17 00:00:00 2001 From: Chris Seieroe Date: Fri, 31 May 2024 22:09:58 -0700 Subject: [PATCH] fix #70 --- CHANGELOG.md | 4 ++++ src/rollers/core.js | 3 +++ src/rollers/midi.js | 3 +++ src/rollers/rsr.js | 3 +++ 4 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01550ef..3cdea01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# upcoming + +- bug fix: [#70](https://github.com/kaelad02/adv-reminder/issues/70) Fix error when using a damage or healing enricher + # 4.0.0 - feature: Support the system's new concentration rolls with sources and messages with `flags.adv-reminder.message.ability.concentration` (system already handles advantage/disadvantage) diff --git a/src/rollers/core.js b/src/rollers/core.js index c030efd..ae090cc 100644 --- a/src/rollers/core.js +++ b/src/rollers/core.js @@ -145,6 +145,9 @@ export default class CoreRollerHooks { preRollDamage(item, config) { debug("preRollDamage hook called"); + // damage/healing enricher doesn't have an item, skip + if (!item) return; + if (this.isFastForwarding(config)) return; const target = getTarget(); const distanceFn = getDistanceToTargetFn(config.messageData.speaker); diff --git a/src/rollers/midi.js b/src/rollers/midi.js index 425f507..cc5730a 100644 --- a/src/rollers/midi.js +++ b/src/rollers/midi.js @@ -104,6 +104,9 @@ export default class MidiRollerHooks extends CoreRollerHooks { preRollDamage(item, config) { debug("preRollDamage hook called"); + // damage/healing enricher doesn't have an item, skip + if (!item) return; + if (this.isFastForwarding(config)) return; const target = getTarget(); // use distance from Midi's Workflow diff --git a/src/rollers/rsr.js b/src/rollers/rsr.js index 15fce74..df663c5 100644 --- a/src/rollers/rsr.js +++ b/src/rollers/rsr.js @@ -138,6 +138,9 @@ export default class ReadySetRollHooks extends CoreRollerHooks { preRollDamage(item, config) { debug("preRollDamage hook called"); + // damage/healing enricher doesn't have an item, skip + if (!item) return; + const target = getTarget(); if (this._doMessages(config)) {