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
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ private static long convertStandardisedToClassic(int rulesetId, long standardise
switch (rulesetId)
{
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:
return (long)Math.Round((objectCount * 1109 + 100000) * standardisedTotalScore / ScoreProcessor.MAX_SCORE);