Skip to content

Commit

Permalink
Merge pull request #26053 from bdach/fix-strict-tracking-sliders
Browse files Browse the repository at this point in the history
Fix strict tracking mod forcefully missing tail before slider start time
  • Loading branch information
peppy authored Dec 22, 2023
2 parents 85c2484 + 30553dc commit 32e1b27
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
53 changes: 53 additions & 0 deletions osu.Game.Rulesets.Osu.Tests/Mods/TestSceneOsuModStrictTracking.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.

using System.Collections.Generic;
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Mods;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Replays;
using osu.Game.Rulesets.Replays;
using osuTK;

namespace osu.Game.Rulesets.Osu.Tests.Mods
{
public partial class TestSceneOsuModStrictTracking : OsuModTestScene
{
[Test]
public void TestSliderInput() => CreateModTest(new ModTestData
{
Mod = new OsuModStrictTracking(),
Autoplay = false,
Beatmap = new Beatmap
{
HitObjects = new List<HitObject>
{
new Slider
{
StartTime = 1000,
Path = new SliderPath
{
ControlPoints =
{
new PathControlPoint(),
new PathControlPoint(new Vector2(0, 100))
}
}
}
}
},
ReplayFrames = new List<ReplayFrame>
{
new OsuReplayFrame(0, new Vector2(), OsuAction.LeftButton),
new OsuReplayFrame(500, new Vector2(200, 0), OsuAction.LeftButton),
new OsuReplayFrame(501, new Vector2(200, 0)),
new OsuReplayFrame(1000, new Vector2(), OsuAction.LeftButton),
new OsuReplayFrame(1750, new Vector2(0, 100), OsuAction.LeftButton),
new OsuReplayFrame(1751, new Vector2(0, 100)),
},
PassCondition = () => Player.ScoreProcessor.Combo.Value == 2
});
}
}
3 changes: 3 additions & 0 deletions osu.Game.Rulesets.Osu/Mods/OsuModStrictTracking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public void ApplyToDrawableHitObject(DrawableHitObject drawable)
{
if (e.NewValue || slider.Judged) return;

if (slider.Time.Current < slider.HitObject.StartTime)
return;

var tail = slider.NestedHitObjects.OfType<StrictTrackingDrawableSliderTail>().First();

if (!tail.Judged)
Expand Down

0 comments on commit 32e1b27

Please sign in to comment.