From 7e2b144bf437c73ab5c68bfa41480250db9ce28b Mon Sep 17 00:00:00 2001 From: WBHarry <89362246+WBHarry@users.noreply.github.com> Date: Wed, 24 Dec 2025 00:11:01 +0100 Subject: [PATCH] Fixed so that the reaction rolls from chat messages work with diceSoNice (#1465) --- module/data/fields/action/saveField.mjs | 32 ++++++++++--------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/module/data/fields/action/saveField.mjs b/module/data/fields/action/saveField.mjs index 473286b1..c9030036 100644 --- a/module/data/fields/action/saveField.mjs +++ b/module/data/fields/action/saveField.mjs @@ -124,29 +124,21 @@ export default class SaveField extends fields.SchemaField { */ static async updateSaveMessage(result, message, targetId) { if (!result) return; - const updateMsg = async function (message, targetId, result) { - // setTimeout(async () => { - const chatMessage = ui.chat.collection.get(message._id), - changes = { - flags: { - [game.system.id]: { - reactionRolls: { - [targetId]: { - result: result.roll.total, - success: result.roll.success - } + + const chatMessage = ui.chat.collection.get(message._id), + changes = { + flags: { + [game.system.id]: { + reactionRolls: { + [targetId]: { + result: result.roll.total, + success: result.roll.success } } } - }; - await chatMessage.update(changes); - // }, 100); - }; - if (game.modules.get('dice-so-nice')?.active) - game.dice3d - .waitFor3DAnimationByMessageID(result.message.id ?? result.message._id) - .then(async () => await updateMsg(message, targetId, result)); - else await updateMsg(message, targetId, result); + } + }; + await chatMessage.update(changes); } /**