Skip to content

Commit

Permalink
Check to see if damage is 0 or below and change it to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaOjala committed Nov 21, 2024
1 parent d411587 commit d886133
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/module/system/damage/roll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,12 @@ class DamageInstance extends AbstractDamageRoll {
return DAMAGE_TYPE_ICONS[this.type];
}

/** Return 0 for persistent damage */
/** Return 0 for persistent damage and 1 if normal damage 0 or less */
protected override _evaluateTotal(): number {
const total = super._evaluateTotal();
if (!this.persistent && total <= 0) {
return 1;
}
return this.persistent && !this.options.evaluatePersistent ? 0 : super._evaluateTotal();
}

Expand Down Expand Up @@ -610,7 +614,7 @@ class DamageInstance extends AbstractDamageRoll {
result.hidden = true;
}
}

this._total = this._evaluateTotal();
return this as Rolled<this>;
}
}
Expand Down

0 comments on commit d886133

Please sign in to comment.