Moved the setting of data.type to d20Roll to not interfer with damageRoll

This commit is contained in:
WBHarry 2025-07-31 21:03:56 +02:00
parent 3e333d3533
commit 8c5a3dbbc5
3 changed files with 6 additions and 6 deletions

View file

@ -149,16 +149,16 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
static toggleReaction() { static toggleReaction() {
if (this.config.roll) { if (this.config.roll) {
this.reactionOverride = !this.reactionOverride; this.reactionOverride = !this.reactionOverride;
this.config.roll.type = this.reactionOverride
? CONFIG.DH.ITEM.actionTypes.reaction.id
: this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id
? null
: this.config.roll.type;
this.render(); this.render();
} }
} }
static async submitRoll() { static async submitRoll() {
this.config.roll.type = this.reactionOverride
? CONFIG.DH.ITEM.actionTypes.reaction.id
: this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id
? null
: this.config.roll.type;
await this.close({ submitted: true }); await this.close({ submitted: true });
} }

View file

@ -145,6 +145,7 @@ export default class D20Roll extends DHRoll {
data.difficulty = config.roll.difficulty; data.difficulty = config.roll.difficulty;
data.success = roll.isCritical || roll.total >= config.roll.difficulty; data.success = roll.isCritical || roll.total >= config.roll.difficulty;
} }
data.type = config.roll.type;
data.advantage = { data.advantage = {
type: config.roll.advantage, type: config.roll.advantage,
dice: roll.dAdvantage?.denomination, dice: roll.dAdvantage?.denomination,

View file

@ -69,7 +69,6 @@ export default class DHRoll extends Roll {
static postEvaluate(roll, config = {}) { static postEvaluate(roll, config = {}) {
return { return {
type: config.roll.type,
total: roll.total, total: roll.total,
formula: roll.formula, formula: roll.formula,
dice: roll.dice.map(d => ({ dice: roll.dice.map(d => ({