Skip to content

Commit

Permalink
fix AttackType Damage Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
marzent committed Sep 18, 2022
1 parent 013a912 commit 3ee2a31
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions NotACT/Datatypes/AttackType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,20 @@ public long Damage {
if (damageCached) {
return cDamage;
}
var num = Items.Where(masterSwing => (long)masterSwing.Damage > 0).Aggregate(0L, (current, masterSwing) => (long)(current + masterSwing.Damage));
cDamage = num;
long _damage = 0;
try
{
_damage = Items.Where(masterSwing => (long)masterSwing.Damage > 0).Aggregate(0L,
(current, masterSwing) => (long)(current + masterSwing.Damage));
}
catch (InvalidOperationException)
{
return Damage;
}

cDamage = _damage;
damageCached = true;
return num;
return _damage;
}
}

Expand Down

0 comments on commit 3ee2a31

Please sign in to comment.