1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:35:35 +08:00

Fix osu star rating calculation

The main bug was that the beatmap was not being processed prior to
having its Skill values calculated, causing stacking to be ignored in
difficulty calculation. The fix involves processing the beatmap with
OsuBeatmapProcessor.

Another minor bug was that sliders were not taking into account the
stacked position midway through the slider (PositionAt does not return
stacked position.), so I corrected by adding StackOffset.
This commit is contained in:
Thomas Tan 2018-01-26 03:39:19 +08:00
parent 08ffd886e3
commit b04e2cbb5c
3 changed files with 3 additions and 4 deletions

View File

@ -29,8 +29,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty
protected override void PreprocessHitObjects()
{
foreach (OsuHitObject h in Beatmap.HitObjects)
(h as Slider)?.Curve?.Calculate();
new OsuBeatmapProcessor().PostProcess(Beatmap);
}
public override double Calculate(Dictionary<string, double> categoryDifficulty = null)

View File

@ -95,7 +95,7 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
var computeVertex = new Action<double>(t =>
{
// ReSharper disable once PossibleInvalidOperationException (bugged in current r# version)
var diff = slider.PositionAt(t) - slider.LazyEndPosition.Value;
var diff = slider.PositionAt(t) + slider.StackOffset - slider.LazyEndPosition.Value;
float dist = diff.Length;
if (dist > approxFollowCircleRadius)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Beatmaps
public abstract class DifficultyCalculator<T> : DifficultyCalculator where T : HitObject
{
protected readonly Beatmap<T> Beatmap;
protected Beatmap<T> Beatmap;
protected readonly Mod[] Mods;
protected DifficultyCalculator(Beatmap beatmap, Mod[] mods = null)