Fixed issue with negative XP on level up.

This commit is contained in:
GJ 2012-04-18 08:19:49 -04:00
parent ea7d1ce0e2
commit e3e2def809

View File

@ -188,14 +188,16 @@ public class Skills {
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (m.getPowerLevelCap() >= PP.getPowerLevel() + 1)) {
PP.removeXP(skillType, PP.getXpToLevel(skillType));
skillups++;
PP.skillUp(skillType, 1);
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
Bukkit.getPluginManager().callEvent(eventToFire);
}
PP.removeXP(skillType, PP.getXpToLevel(skillType));
else {
PP.addLevels(skillType, 0);
}
}
if (!LoadProperties.useMySQL) {