Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report . level up before reaching xp limit #1164

Open
1 task done
DarkStar0534 opened this issue Jan 5, 2022 · 6 comments
Open
1 task done

🐛 Bug Report . level up before reaching xp limit #1164

DarkStar0534 opened this issue Jan 5, 2022 · 6 comments
Labels
A-Bot Area: Bot, i.e: Related to the bot C-Other Category: Other, i.e: This issue doesn't fit any other category E-Production Environment: Production F-Level Feature: Level System G-Discussion Call for participation: A discussion is needed for the issue P-Medium Medium priority

Comments

@DarkStar0534
Copy link

DarkStar0534 commented Jan 5, 2022

👟 Reproduction steps

I had 40/50xp i went on an adventure i got 5xp and i leveled up(to level 2) even the limit was 50xp not 45xp

👍 Expected behavior

level up tp level 2 after overgoing the xp limit

👎 Actual Behavior

levels up hefore reaching the level xp requirement

🎲 DRPG version

4.17.9

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

📝 Additional context

thank you for reading

@Willard21
Copy link
Member

Pretty simple problem. We're adding xp, then checking new xp + gained xp for the next level. Just remove the + xpWin and it should be fixed.
image

@Sven65
Copy link
Contributor

Sven65 commented May 9, 2022

Not that big of an issue, player will still need to gather the required xp for the next level and I haven't seen it happen other than this report. Closing this issue.

@Sven65 Sven65 closed this as completed May 9, 2022
@Willard21
Copy link
Member

I sent a screenshot of the code that proves this happens 100% of the time... Why close a bug report when it's a bug and hasn't been fixed?

@Willard21 Willard21 reopened this May 9, 2022
@Sven65
Copy link
Contributor

Sven65 commented Oct 23, 2022

Removing your code snippet does fix the issue, but breaks the XP progress bar in adventure embed 3.

See without;
image

and with
image

Considering that the logic is shared amongst the three display options, I don't see a straight-forward way of fixing the issue without specific logic for the xp progress bar.

@Sven65 Sven65 added A-Bot Area: Bot, i.e: Related to the bot E-Production Environment: Production F-Level Feature: Level System G-Discussion Call for participation: A discussion is needed for the issue C-Other Category: Other, i.e: This issue doesn't fit any other category P-Medium Medium priority labels Oct 23, 2022
@Sven65
Copy link
Contributor

Sven65 commented Oct 24, 2022

cc @Willard21, do you have any input on this?

@Willard21
Copy link
Member

Which part did you remove? The userData.xp += xpWin or the + xpWin? The xp bar uses the current value of userData.xp so it should work fine with

userData.xp += xpWin
...
    levels: getLevelByXP(userData.xp)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Bot Area: Bot, i.e: Related to the bot C-Other Category: Other, i.e: This issue doesn't fit any other category E-Production Environment: Production F-Level Feature: Level System G-Discussion Call for participation: A discussion is needed for the issue P-Medium Medium priority
Projects
None yet
Development

No branches or pull requests

3 participants