From 3ec552525fa5a87e32199bab075ce8774b457e46 Mon Sep 17 00:00:00 2001 From: Chris Seieroe Date: Fri, 23 Feb 2024 14:59:26 -0800 Subject: [PATCH] fixes #60 by using the updated hook parameters --- CHANGELOG.md | 4 ++++ src/rollers/core.js | 9 +++++---- src/rollers/midi.js | 7 ++++--- src/rollers/rsr.js | 9 +++++---- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0095c55..850ae84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 3.3.2 + +- bug fix: [#60](https://github.com/kaelad02/adv-reminder/issues/60) Fix tool checks to show advantage and messages again after the check was moved from the item to the actor + # 3.3.1 - bug fix: [#56](https://github.com/kaelad02/adv-reminder/issues/56) Fully support messages on damage rolls other than attacks diff --git a/src/rollers/core.js b/src/rollers/core.js index d3b265e..c062fe2 100644 --- a/src/rollers/core.js +++ b/src/rollers/core.js @@ -106,14 +106,15 @@ export default class CoreRollerHooks { new SkillReminder(actor, skillId, this.checkArmorStealth).updateOptions(config); } - preRollToolCheck(item, config) { + preRollToolCheck(actor, config, toolId) { debug("preRollToolCheck hook called"); if (this.isFastForwarding(config)) return; - new AbilityCheckMessage(item.actor, item.system.ability).addMessage(config); - if (showSources) new AbilityCheckSource(item.actor, item.system.ability).updateOptions(config); - new AbilityCheckReminder(item.actor, item.system.ability).updateOptions(config); + const ability = config.data.defaultAbility; + new AbilityCheckMessage(actor, ability).addMessage(config); + if (showSources) new AbilityCheckSource(actor, ability).updateOptions(config); + new AbilityCheckReminder(actor, ability).updateOptions(config); } preRollDeathSave(actor, config) { diff --git a/src/rollers/midi.js b/src/rollers/midi.js index f8ddab6..d7c9b83 100644 --- a/src/rollers/midi.js +++ b/src/rollers/midi.js @@ -63,13 +63,14 @@ export default class MidiRollerHooks extends CoreRollerHooks { if (showSources) new SkillSource(actor, skillId, true).updateOptions(config); } - preRollToolCheck(item, config) { + preRollToolCheck(actor, config, toolId) { debug("preRollToolCheck hook called"); if (this.isFastForwarding(config)) return; - new AbilityCheckMessage(item.actor, item.system.ability).addMessage(config); - if (showSources) new AbilityCheckSource(item.actor, item.system.ability).updateOptions(config); + const ability = config.data.defaultAbility; + new AbilityCheckMessage(actor, ability).addMessage(config); + if (showSources) new AbilityCheckSource(actor, ability).updateOptions(config); } preRollDeathSave(actor, config) { diff --git a/src/rollers/rsr.js b/src/rollers/rsr.js index 8d2d7f5..4dd8981 100644 --- a/src/rollers/rsr.js +++ b/src/rollers/rsr.js @@ -92,17 +92,18 @@ export default class ReadySetRollHooks extends CoreRollerHooks { new SkillReminder(actor, skillId, this.checkArmorStealth).updateOptions(config); } - preRollToolCheck(item, config) { + preRollToolCheck(actor, config, toolId) { debug("preRollToolCheck hook called"); + const ability = config.data.defaultAbility; if (this._doMessages(config)) { - new AbilityCheckMessage(item.actor, item.system.ability).addMessage(config); + new AbilityCheckMessage(actor, ability).addMessage(config); if (showSources) - new AbilityCheckSource(item.actor, item.system.ability).updateOptions(config); + new AbilityCheckSource(actor, ability).updateOptions(config); } if (this._doReminder(config)) - new AbilityCheckReminder(item.actor, item.system.ability).updateOptions(config); + new AbilityCheckReminder(actor, ability).updateOptions(config); } preRollDeathSave(actor, config) {