Fix mania difficulty calculator crashing

This commit is contained in:
smoogipoo
2021-10-01 19:57:45 +09:00
parent 36be041846
commit 5820a71652
3 changed files with 28 additions and 22 deletions

View File

@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
Mods = mods,
// Todo: This int cast is temporary to achieve 1:1 results with osu!stable, and should be removed in the future
GreatHitWindow = (int)Math.Ceiling(getHitWindow300(mods) / clockRate),
ScoreMultiplier = getScoreMultiplier(beatmap, mods),
ScoreMultiplier = getScoreMultiplier(mods),
MaxCombo = beatmap.HitObjects.Sum(h => h is HoldNote ? 2 : 1),
Skills = skills
};
@ -70,7 +70,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[]
{
new Strain(mods, ((ManiaBeatmap)beatmap).TotalColumns)
new Strain(mods, ((ManiaBeatmap)Beatmap).TotalColumns)
};
protected override Mod[] DifficultyAdjustmentMods
@ -138,7 +138,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
}
}
private double getScoreMultiplier(IBeatmap beatmap, Mod[] mods)
private double getScoreMultiplier(Mod[] mods)
{
double scoreMultiplier = 1;
@ -154,7 +154,7 @@ namespace osu.Game.Rulesets.Mania.Difficulty
}
}
var maniaBeatmap = (ManiaBeatmap)beatmap;
var maniaBeatmap = (ManiaBeatmap)Beatmap;
int diff = maniaBeatmap.TotalColumns - maniaBeatmap.OriginalTotalColumns;
if (diff > 0)