From fcc2691f4be23ea77ec0603b6baa281875416c07 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Fri, 24 May 2024 15:21:12 +0200 Subject: [PATCH] v12 fixes : Fix rolls --- system/scripts/dice/roll-n-keep-dialog.js | 2 +- system/scripts/dice/roll.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/system/scripts/dice/roll-n-keep-dialog.js b/system/scripts/dice/roll-n-keep-dialog.js index ef1f65a..0af1387 100644 --- a/system/scripts/dice/roll-n-keep-dialog.js +++ b/system/scripts/dice/roll-n-keep-dialog.js @@ -145,7 +145,7 @@ export class RollnKeepDialog extends FormApplication { } // Get the roll - this.roll = game.l5r5e.RollL5r5e.fromData(this.messageRoll); + this.roll = this.messageRoll; // Already history if (Array.isArray(this.roll.l5r5e.history)) { diff --git a/system/scripts/dice/roll.js b/system/scripts/dice/roll.js index dd7f232..2423b1d 100644 --- a/system/scripts/dice/roll.js +++ b/system/scripts/dice/roll.js @@ -327,7 +327,7 @@ export class RollL5r5e extends Roll { * This function can either create the ChatMessage directly, or return the data object that will be used to create. * @override */ - async toMessage(messageData = {}, { rollMode = null, create = true } = {}) { + async toMessage(messageData = {}, { rollMode = null } = {}) { // Perform the roll, if it has not yet been rolled if (!this._evaluated) { await this.evaluate(); @@ -356,12 +356,11 @@ export class RollL5r5e extends Roll { }, messageData ); - messageData.roll = this; + messageData.rolls = [this]; // Either create the message or just return the chat data return ChatMessage.implementation.create(messageData, { rollMode: rMode, - temporary: !create, }); }