1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Fix classic scoring overflowing in osu! ruleset due to integer multiplication overflow

Closes https://github.com/ppy/osu/issues/25545.
This commit is contained in:
Bartłomiej Dach 2023-11-23 08:15:46 +09:00
parent 3441a9a5b5
commit e28e0ef1cc
No known key found for this signature in database

View File

@ -50,7 +50,7 @@ namespace osu.Game.Scoring.Legacy
switch (rulesetId) switch (rulesetId)
{ {
case 0: case 0:
return (long)Math.Round((objectCount * objectCount * 32.57 + 100000) * standardisedTotalScore / ScoreProcessor.MAX_SCORE); return (long)Math.Round((Math.Pow(objectCount, 2) * 32.57 + 100000) * standardisedTotalScore / ScoreProcessor.MAX_SCORE);
case 1: case 1:
return (long)Math.Round((objectCount * 1109 + 100000) * standardisedTotalScore / ScoreProcessor.MAX_SCORE); return (long)Math.Round((objectCount * 1109 + 100000) * standardisedTotalScore / ScoreProcessor.MAX_SCORE);