Skip to content

Commit

Permalink
fix: damage roll for psionic use with negative effect (#1694)
Browse files Browse the repository at this point in the history
This release fixes an issue where damage rolls were made for psionic abilities when the skill roll failed (negative effect).
  • Loading branch information
marvin9257 authored Nov 22, 2024
1 parent baebe37 commit 0162c5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/module/entities/TwodsixItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -787,8 +787,9 @@ export default class TwodsixItem extends Item {
await this.sendPsiUseToChat(psiCost, rollMode, rollEffect);

// Roll damage and post, if necessary
if (this.system.damage !== "" && this.system.damage !== "0" && game.settings.get("twodsix", "automateDamageRollOnHit")) {
const damagePayload = await this.rollDamage(rollMode || game.settings.get('core', 'rollMode'), ` ${rollEffect}`, true, showThrowDiag);
if (this.system.damage !== "" && this.system.damage !== "0" && game.settings.get("twodsix", "automateDamageRollOnHit") && rollEffect >=0 ) {
const bonusDamage:string = game.settings.get("twodsix", "addEffectToDamage") && rollEffect !== 0 ? ` ${rollEffect}` : ``;
const damagePayload = await this.rollDamage(rollMode || game.settings.get('core', 'rollMode'), bonusDamage, true, showThrowDiag);
if (damagePayload?.damageValue > 0) {
const targetTokens = Array.from(game.user.targets);
if (targetTokens.length > 0) {
Expand Down

0 comments on commit 0162c5b

Please sign in to comment.