Skip to content

Commit

Permalink
fix: ignore 0 damage
Browse files Browse the repository at this point in the history
  • Loading branch information
VytorCalixto committed Nov 20, 2024
1 parent 938480b commit 6d1e49d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/features/encounters/providers/encounters_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ class EncountersProvider extends ChangeNotifier {
Combatant combatant,
int health,
) async {
final damage = combatant.currentHp - health;
if (damage == 0) {
return;
}

final log = DamageCombatantLog(
round: encounter.round,
turn: encounter.turn,
combatant: combatant,
damage: combatant.currentHp - health,
damage: damage,
);

final updated = log.apply(encounter);
Expand Down

0 comments on commit 6d1e49d

Please sign in to comment.