mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-03 18:33:16 +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) {
|
public static void XpCheckSkill(SkillType skillType, Player player) {
|
||||||
PlayerProfile PP = Users.getProfile(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;
|
int skillups = 0;
|
||||||
|
|
||||||
while (skillXpLevel >= xpToNextLevel) {
|
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
||||||
if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) {
|
if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) {
|
||||||
skillups++;
|
skillups++;
|
||||||
PP.addLevels(skillType, 1);
|
PP.addLevels(skillType, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user