aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-12-02 10:53:31 -0500
committerbowser0000 <bowser0000@gmail.com>2020-12-02 10:53:31 -0500
commit4e29567d404f469c937f4a1981dc7bccb8de9455 (patch)
treea3790c35dcd5199db7d4116ce30bea232d186c4d /src/main/java/me
parentd3b451bfe6a9703036cfb49236ca85ab28431836 (diff)
downloadSkyblockMod-4e29567d404f469c937f4a1981dc7bccb8de9455.tar.gz
SkyblockMod-4e29567d404f469c937f4a1981dc7bccb8de9455.tar.bz2
SkyblockMod-4e29567d404f469c937f4a1981dc7bccb8de9455.zip
Fix being over skill level 50 returning wrong past xp earned
Diffstat (limited to 'src/main/java/me')
-rw-r--r--src/main/java/me/Danker/utils/Utils.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java
index 33021af..9d460bc 100644
--- a/src/main/java/me/Danker/utils/Utils.java
+++ b/src/main/java/me/Danker/utils/Utils.java
@@ -239,7 +239,13 @@ public class Utils {
}
public static int getPastXpEarned(int currentLevelXp, int limit) {
- if (currentLevelXp == 0) return skillXPPerLevel[limit];
+ if (currentLevelXp == 0) {
+ int xpAdded = 0;
+ for (int i = 1; i <= limit; i++) {
+ xpAdded += skillXPPerLevel[i];
+ }
+ return xpAdded;
+ }
for (int i = 1, xpAdded = 0; i <= limit; i++) {
xpAdded += skillXPPerLevel[i - 1];
if (currentLevelXp == skillXPPerLevel[i]) return xpAdded;