diff --git a/module/deltagreen.js b/module/deltagreen.js index 0734e31..14d608c 100644 --- a/module/deltagreen.js +++ b/module/deltagreen.js @@ -15,7 +15,6 @@ import { rollSkillMacro, rollSkillTestAndDamageForOwnedItem, } from "./other/macro-functions.js"; -import DGUtils from "./other/utility-functions.js"; import { handleInlineActions } from "./other/inline.js"; Hooks.once("init", async () => { @@ -202,8 +201,8 @@ Hooks.on("renderGamePause", function (_, html, options) { Hooks.on("renderChatLog", async (app, element, context, options) => { element.addEventListener("click", (event) => { - const btnWithAction = DGUtils.htmlClosest(event.target, "button[data-action]"); - const message = DGUtils.htmlClosest(event.target, "li[data-message-id]"); + const btnWithAction = event.target.closest("button[data-action]"); + const message = event.target.closest("li[data-message-id]") const { messageId } = message?.dataset || {} if (btnWithAction && messageId) { diff --git a/module/other/utility-functions.js b/module/other/utility-functions.js index c6fe5fd..dabf602 100644 --- a/module/other/utility-functions.js +++ b/module/other/utility-functions.js @@ -33,11 +33,4 @@ export default class DGUtils { static formatStringWithLeadingPlus(number) { return number > 0 ? `+${number}` : number.toString(); } - - static htmlClosest(element, selectors) { - if (element instanceof Element) { - return element.closest(selectors); - } - return null - } } diff --git a/module/roll/roll.js b/module/roll/roll.js index 19ad313..63be2c1 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -409,8 +409,8 @@ export class DGPercentileRoll extends DGRoll { } get exhausted() { - const isExhausted = false; - const exhaustedCheckPenalty = -20; + let isExhausted = false; + let exhaustedCheckPenalty = -20; try { // I suspect (but am not entirely certain) that being tired doesn't make you less lucky)