Skip to content

Commit

Permalink
Also check targetHp for damageNpSafe
Browse files Browse the repository at this point in the history
  • Loading branch information
SharpnelXu committed Aug 17, 2024
1 parent 7ca3a7e commit 8657714
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/app/battle/functions/damage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ class Damage {

// real
int totalDamage = await DamageAdjustor.show(battleData, activator, target, damageParameters, currentCard, multiAttack,);
if (funcType == FuncType.damageNpSafe && totalDamage >= target.hp) {
if (funcType == FuncType.damageNpSafe && target.hp > 0 && totalDamage >= target.hp) {
totalDamage = target.hp - 1;
}

Expand Down

0 comments on commit 8657714

Please sign in to comment.