mirror of
https://github.com/ppy/osu
synced 2024-12-21 22:30:36 +00:00
Fix mania Autoplay mod missing 0ms hold notes
This commit is contained in:
parent
a553387c3d
commit
b20b2203ac
@ -0,0 +1,42 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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.Rulesets.Mania.Beatmaps;
|
||||
using osu.Game.Rulesets.Mania.Objects;
|
||||
using osu.Game.Tests.Visual;
|
||||
|
||||
namespace osu.Game.Rulesets.Mania.Tests.Mods
|
||||
{
|
||||
public partial class TestSceneManiaModAutoplay : ModTestScene
|
||||
{
|
||||
protected override Ruleset CreatePlayerRuleset() => new ManiaRuleset();
|
||||
|
||||
[Test]
|
||||
public void TestPerfectScoreOnShortHoldNote()
|
||||
{
|
||||
CreateModTest(new ModTestData
|
||||
{
|
||||
Autoplay = true,
|
||||
Beatmap = new ManiaBeatmap(new StageDefinition(1))
|
||||
{
|
||||
HitObjects = new List<ManiaHitObject>
|
||||
{
|
||||
new HoldNote
|
||||
{
|
||||
StartTime = 100,
|
||||
EndTime = 100,
|
||||
},
|
||||
new HoldNote
|
||||
{
|
||||
StartTime = 100.1,
|
||||
EndTime = 150,
|
||||
},
|
||||
}
|
||||
},
|
||||
PassCondition = () => Player.ScoreProcessor.Combo.Value == 4
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -87,15 +87,22 @@ namespace osu.Game.Rulesets.Mania.Replays
|
||||
private double calculateReleaseTime(HitObject currentObject, HitObject? nextObject)
|
||||
{
|
||||
double endTime = currentObject.GetEndTime();
|
||||
double releaseDelay = RELEASE_DELAY;
|
||||
|
||||
if (currentObject is HoldNote)
|
||||
// hold note releases must be timed exactly.
|
||||
return endTime;
|
||||
if (currentObject is HoldNote hold)
|
||||
{
|
||||
if (hold.Duration > 0)
|
||||
// hold note releases must be timed exactly.
|
||||
return endTime;
|
||||
|
||||
// Special case for super short hold notes
|
||||
releaseDelay = 1;
|
||||
}
|
||||
|
||||
bool canDelayKeyUpFully = nextObject == null ||
|
||||
nextObject.StartTime > endTime + RELEASE_DELAY;
|
||||
nextObject.StartTime > endTime + releaseDelay;
|
||||
|
||||
return endTime + (canDelayKeyUpFully ? RELEASE_DELAY : (nextObject.AsNonNull().StartTime - endTime) * 0.9);
|
||||
return endTime + (canDelayKeyUpFully ? releaseDelay : (nextObject.AsNonNull().StartTime - endTime) * 0.9);
|
||||
}
|
||||
|
||||
protected override HitObject? GetNextObject(int currentIndex)
|
||||
|
Loading…
Reference in New Issue
Block a user