Skip to content

Commit

Permalink
fix: Infusions not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Shourn committed Jan 15, 2025
1 parent 6867249 commit 865ce6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions module/checks/checks-v2.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 865ce6b

Please sign in to comment.