From 6cfc8c7a529d480641280d71f75aee94e1c8d5d4 Mon Sep 17 00:00:00 2001 From: GJ Date: Tue, 27 Mar 2012 17:12:38 -0400 Subject: [PATCH] Fixed bug with gaining infinite levels. (Oops.) --- src/main/java/com/gmail/nossr50/skills/Skills.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/Skills.java b/src/main/java/com/gmail/nossr50/skills/Skills.java index cce6314fd..d49ccf14e 100644 --- a/src/main/java/com/gmail/nossr50/skills/Skills.java +++ b/src/main/java/com/gmail/nossr50/skills/Skills.java @@ -190,13 +190,11 @@ public class Skills { */ public static void XpCheckSkill(SkillType skillType, Player player) { PlayerProfile PP = Users.getProfile(player); - int skillXpLevel = PP.getSkillXpLevel(skillType); - int xpToNextLevel = PP.getXpToLevel(skillType); - if (skillXpLevel >= xpToNextLevel) { + if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { int skillups = 0; - while (skillXpLevel >= xpToNextLevel) { + while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) { if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) { skillups++; PP.addLevels(skillType, 1);