agility plugin: fix calculating laps to level when leveling up from a lap

This commit is contained in:
AWarbear
2018-05-05 21:44:43 -04:00
committed by Adam
parent 4701948052
commit 1ea26ccd03

View File

@@ -54,7 +54,13 @@ public class AgilitySession
int currentExp = client.getSkillExperience(Skill.AGILITY);
int nextLevel = client.getRealSkillLevel(Skill.AGILITY) + 1;
int remainingXp = nextLevel <= Experience.MAX_VIRT_LEVEL ? Experience.getXpForLevel(nextLevel) - currentExp : 0;
int remainingXp;
do
{
remainingXp = nextLevel <= Experience.MAX_VIRT_LEVEL ? Experience.getXpForLevel(nextLevel) - currentExp : 0;
nextLevel++;
} while (remainingXp < 0);
lapsTillLevel = remainingXp > 0 ? (int) Math.ceil(remainingXp / course.getTotalXp()) : 0;
}