skillcalc: use double precision for xp

Doing the xp calculation with floats and then converting it to double is
less precise, and causes minor errors that accumulate with very large xp
ranges
This commit is contained in:
Adam
2021-10-27 16:58:19 -04:00
parent ff9c15d52c
commit 9e8551d832

View File

@@ -343,9 +343,8 @@ class SkillCalculator extends JPanel
int actionCount = 0;
int neededXP = targetXP - currentXP;
SkillAction action = slot.getAction();
float xp = action.isIgnoreBonus()
? action.getXp()
: Math.round(action.getXp() * xpFactor * 10f) / 10f;
final float bonus = action.isIgnoreBonus() ? 1f : xpFactor;
final double xp = Math.round(action.getXp() * bonus * 10f) / 10d;
if (neededXP > 0)
{