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

Classic scoring can reach negative values due to int overflow #25545

Closed
WitherFlower opened this issue Nov 22, 2023 · 0 comments · Fixed by #25546
Closed

Classic scoring can reach negative values due to int overflow #25545

WitherFlower opened this issue Nov 22, 2023 · 0 comments · Fixed by #25546
Assignees

Comments

@WitherFlower
Copy link
Contributor

WitherFlower commented Nov 22, 2023

Type

Game behaviour

Bug description

Example map : https://osu.ppy.sh/beatmapsets/1427667#osu/2939553

This happens on any map with more than sqrt(2^31-1) objects (~46k), and is due to int overflow in the objectCount * objectCount multiplication in the following code :

return (long)Math.Round((objectCount * objectCount * 32.57 + 100000) * standardisedTotalScore / ScoreProcessor.MAX_SCORE);

One would hope changing objectCount to a long should resolve the issue, as the overflow limit would now be sqrt(2^63-1) hitobjects, or a little bit above 3 billion...

Screenshots or videos

osu_2023-11-22_23-51-23

Version

2023.1114.1-lazer

Logs

logs.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants