From 4e29567d404f469c937f4a1981dc7bccb8de9455 Mon Sep 17 00:00:00 2001 From: bowser0000 Date: Wed, 2 Dec 2020 10:53:31 -0500 Subject: Fix being over skill level 50 returning wrong past xp earned --- src/main/java/me/Danker/utils/Utils.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/me') 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; -- cgit