Improved HuntPass addPassPoint method calculation.

Contributed by Index.
This commit is contained in:
MobiusDevelopment
2022-07-27 19:32:14 +00:00
parent 2d4b9fbabb
commit 85ac1990a9
2 changed files with 4 additions and 8 deletions

View File

@@ -180,16 +180,14 @@ public class HuntPass
final int seasonPasspoint = 1; final int seasonPasspoint = 1;
int calculate = seasonPasspoint + getPoints(); int calculate = seasonPasspoint + getPoints();
boolean hasNewLevel = false; boolean hasNewLevel = false;
int calculateMe = getPoints(); while (calculate >= Config.HUNT_PASS_POINTS_FOR_STEP)
while (calculateMe >= Config.HUNT_PASS_POINTS_FOR_STEP)
{ {
calculateMe = calculateMe - Config.HUNT_PASS_POINTS_FOR_STEP; calculate = calculate - Config.HUNT_PASS_POINTS_FOR_STEP;
setCurrentStep(getCurrentStep() + 1); setCurrentStep(getCurrentStep() + 1);
hasNewLevel = true; hasNewLevel = true;
} }
if (hasNewLevel) if (hasNewLevel)
{ {
calculate %= Config.HUNT_PASS_POINTS_FOR_STEP;
setRewardAlert(true); setRewardAlert(true);
_user.sendPacket(new HuntPassSimpleInfo(_user)); _user.sendPacket(new HuntPassSimpleInfo(_user));
} }

View File

@@ -180,16 +180,14 @@ public class HuntPass
final int seasonPasspoint = 1; final int seasonPasspoint = 1;
int calculate = seasonPasspoint + getPoints(); int calculate = seasonPasspoint + getPoints();
boolean hasNewLevel = false; boolean hasNewLevel = false;
int calculateMe = getPoints(); while (calculate >= Config.HUNT_PASS_POINTS_FOR_STEP)
while (calculateMe >= Config.HUNT_PASS_POINTS_FOR_STEP)
{ {
calculateMe = calculateMe - Config.HUNT_PASS_POINTS_FOR_STEP; calculate = calculate - Config.HUNT_PASS_POINTS_FOR_STEP;
setCurrentStep(getCurrentStep() + 1); setCurrentStep(getCurrentStep() + 1);
hasNewLevel = true; hasNewLevel = true;
} }
if (hasNewLevel) if (hasNewLevel)
{ {
calculate %= Config.HUNT_PASS_POINTS_FOR_STEP;
setRewardAlert(true); setRewardAlert(true);
_user.sendPacket(new HuntPassSimpleInfo(_user)); _user.sendPacket(new HuntPassSimpleInfo(_user));
} }