mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Fixed bug with gaining infinite levels. (Oops.)
This commit is contained in:
parent
fd6610f966
commit
6cfc8c7a52
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user