skillcalc: round bonus xp to nearest tenth

XP cannot be more precise than a 10th of an xp. This was compute more precise xp values and when applied over many actions caused the computed actions to be incorrect
This commit is contained in:
Adam
2021-10-26 21:46:24 -04:00
parent b9191114fa
commit 8197de776f

View File

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