mirror of
https://github.com/moparisthebest/MoparClassic
synced 2024-12-23 07:58: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() {
|
public double getRangePortion() {
|
||||||
|
if (getTotalDamage() == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return getRangeDamage() / getTotalDamage();
|
return getRangeDamage() / getTotalDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getMagicPortion() {
|
public double getMagicPortion() {
|
||||||
|
if (getTotalDamage() == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return getMagicDamage() / getTotalDamage();
|
return getMagicDamage() / getTotalDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getCombatPortion() {
|
public double getCombatPortion() {
|
||||||
|
if (getTotalDamage() == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return getCombatDamage() / getTotalDamage();
|
return getCombatDamage() / getTotalDamage();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user