mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-22 23:48:48 -05:00
Resolves errors being thrown randomly due to divide by 0
This commit is contained in:
parent
1a59778484
commit
bf92ee7a3e
@ -64,14 +64,23 @@ public class Damage {
|
||||
}
|
||||
|
||||
public double getRangePortion() {
|
||||
if (getTotalDamage() == 0) {
|
||||
return 0;
|
||||
}
|
||||
return getRangeDamage() / getTotalDamage();
|
||||
}
|
||||
|
||||
public double getMagicPortion() {
|
||||
if (getTotalDamage() == 0) {
|
||||
return 0;
|
||||
}
|
||||
return getMagicDamage() / getTotalDamage();
|
||||
}
|
||||
|
||||
public double getCombatPortion() {
|
||||
if (getTotalDamage() == 0) {
|
||||
return 0;
|
||||
}
|
||||
return getCombatDamage() / getTotalDamage();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user