Skip to content

Commit

Permalink
[foundryvtt#3910] Fix bug in preparing formulas with bonuses
Browse files Browse the repository at this point in the history
  • Loading branch information
arbron committed Aug 2, 2024
1 parent 6bfbe01 commit 519487f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/data/shared/damage-field.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class DamageData extends foundry.abstract.DataModel {
let formula;
const number = (this.number ?? 0) + increase;
if ( number && this.denomination ) formula = `${number}d${this.denomination}`;
if ( this.bonus ) formula = formula ? `${formula} + ${bonus}` : bonus;
if ( this.bonus ) formula = formula ? `${formula} + ${this.bonus}` : this.bonus;
return formula ?? "";
}

Expand All @@ -104,6 +104,7 @@ export class DamageData extends foundry.abstract.DataModel {
default: increase = 0; break;
}
if ( !increase ) return this.formula;
let formula;

// If dice count scaling, increase the count on the first die rolled
const dieIncrease = (this.scaling.number ?? 0) * increase;
Expand Down

0 comments on commit 519487f

Please sign in to comment.