v9 - roll now async (sync is removed in v10)

This commit is contained in:
Vlyan
2021-12-21 12:50:59 +01:00
parent 8080016b6a
commit 2173cc6150
5 changed files with 11 additions and 11 deletions

View File

@@ -56,7 +56,7 @@ export class RollL5r5e extends Roll {
* Execute the Roll, replacing dice and evaluating the total result
* @override
**/
evaluate({ minimize = false, maximize = false, async = false } = {}) {
async evaluate({ minimize = false, maximize = false, async = true } = {}) {
if (this._evaluated) {
throw new Error("This Roll object has already been rolled.");
}
@@ -71,7 +71,7 @@ export class RollL5r5e extends Roll {
this._total = 0;
// Roll
super.evaluate({ minimize, maximize, async });
await super.evaluate({ minimize, maximize, async });
this._evaluated = true;
// Save initial formula
@@ -297,7 +297,7 @@ export class RollL5r5e extends Roll {
async toMessage(messageData = {}, { rollMode = null, create = true } = {}) {
// Perform the roll, if it has not yet been rolled
if (!this._evaluated) {
this.evaluate({ async: false });
await this.evaluate();
}
// RollMode