Fix token/actor
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { EcrymeUtility } from "../common/ecryme-utility.js";
|
||||
import {EcrymeConfrontDialog } from "./ecryme-confront-dialog.js";
|
||||
import { EcrymeConfrontDialog } from "./ecryme-confront-dialog.js";
|
||||
|
||||
export class EcrymeConfrontStartDialog extends Dialog {
|
||||
|
||||
@@ -43,12 +43,12 @@ export class EcrymeConfrontStartDialog extends Dialog {
|
||||
|
||||
super(conf, options);
|
||||
|
||||
this.actor = actor;
|
||||
this.actor = actor?.token?.actor || actor;
|
||||
this.rollData = rollData;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async rollConfront( diceFormula ) {
|
||||
async rollConfront(diceFormula) {
|
||||
// Do the initial roll
|
||||
let myRoll = await new Roll(diceFormula).roll()
|
||||
await EcrymeUtility.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
|
||||
@@ -57,7 +57,7 @@ export class EcrymeConfrontStartDialog extends Dialog {
|
||||
rollData.roll = foundry.utils.duplicate(myRoll)
|
||||
rollData.availableDices = []
|
||||
for (let result of myRoll.terms[0].results) {
|
||||
if ( !result.discarded) {
|
||||
if (!result.discarded) {
|
||||
let resultDup = foundry.utils.duplicate(result)
|
||||
resultDup.location = "mainpool"
|
||||
rollData.availableDices.push(resultDup)
|
||||
|
||||
Reference in New Issue
Block a user