From 865ce6b1cd93873ca5f63ea7b96ff910e5c5b63f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Jahns?= Date: Wed, 15 Jan 2025 11:06:45 +0100 Subject: [PATCH] fix: Infusions not working --- module/checks/checks-v2.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/module/checks/checks-v2.mjs b/module/checks/checks-v2.mjs index 2a3f3d26..58325d9b 100644 --- a/module/checks/checks-v2.mjs +++ b/module/checks/checks-v2.mjs @@ -145,7 +145,7 @@ const checkFromCheckResult = (check) => { * @param {CheckResultV2} check * @param {FUActor} actor * @param {FUItem} item - * @return {Promise<{[roll]: Roll, [check]: CheckV2} | boolean>} + * @return {Promise<{[roll]: Roll, [check]: CheckV2} | boolean | void>} returning false will abort the operation, returning nothing, true or an object with changed check configuration will proceed */ /** * @param {CheckId} checkId @@ -159,7 +159,10 @@ const modifyCheck = async (checkId, callback) => { const oldResult = foundry.utils.duplicate(message.getFlag(SYSTEM, Flags.ChatMessage.CheckV2)); const actor = await fromUuid(oldResult.actorUuid); const item = await fromUuid(oldResult.itemUuid); - const callbackResult = await callback(oldResult, actor, item); + let callbackResult = await callback(oldResult, actor, item); + if (typeof callbackResult === 'undefined') { + callbackResult = true; + } if (callbackResult) { const { check = checkFromCheckResult(oldResult), roll = Roll.fromData(oldResult.roll) } = (typeof callbackResult === 'object' && callbackResult) ?? {}; const result = await processResult(check, roll, actor, item);