mirror of https://github.com/ppy/osu
Fix mania notelock crashing with overlapping hitwindows
This commit is contained in:
parent
6593aac3f2
commit
1173ef0890
|
@ -47,7 +47,7 @@ public void TestNoInput()
|
|||
assertHeadJudgement(HitResult.Miss);
|
||||
assertTickJudgement(HitResult.LargeTickMiss);
|
||||
assertTailJudgement(HitResult.Miss);
|
||||
assertNoteJudgement(HitResult.IgnoreHit);
|
||||
assertNoteJudgement(HitResult.IgnoreMiss);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -54,6 +54,29 @@ public void TestPreviousHitWindowDoesNotExtendPastNextObject()
|
|||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestMissAfterNextObjectStartTime()
|
||||
{
|
||||
var objects = new List<ManiaHitObject>
|
||||
{
|
||||
new HoldNote
|
||||
{
|
||||
StartTime = 1000,
|
||||
EndTime = 1200,
|
||||
},
|
||||
new HoldNote
|
||||
{
|
||||
StartTime = 1220,
|
||||
EndTime = 1420
|
||||
}
|
||||
};
|
||||
|
||||
performTest(objects, new List<ReplayFrame>());
|
||||
|
||||
addJudgementAssert(objects[0], HitResult.IgnoreMiss);
|
||||
addJudgementAssert(objects[1], HitResult.IgnoreMiss);
|
||||
}
|
||||
|
||||
private void addJudgementAssert(ManiaHitObject hitObject, HitResult result)
|
||||
{
|
||||
AddAssert($"({hitObject.GetType().ReadableName()} @ {hitObject.StartTime}) judgement is {result}",
|
||||
|
|
|
@ -233,7 +233,7 @@ protected override void CheckForResult(bool userTriggered, double timeOffset)
|
|||
{
|
||||
if (Tail.AllJudged)
|
||||
{
|
||||
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||
ApplyResult(r => r.Type = Tail.IsHit ? r.Judgement.MaxResult : r.Judgement.MinResult);
|
||||
endHold();
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ public bool IsHittable(DrawableHitObject hitObject, double time)
|
|||
/// <param name="hitObject">The <see cref="HitObject"/> that was hit.</param>
|
||||
public void HandleHit(DrawableHitObject hitObject)
|
||||
{
|
||||
if (!IsHittable(hitObject, hitObject.HitObject.StartTime + hitObject.Result.TimeOffset))
|
||||
if (hitObject.IsHit && !IsHittable(hitObject, hitObject.HitObject.StartTime + hitObject.Result.TimeOffset))
|
||||
throw new InvalidOperationException($"A {hitObject} was hit before it became hittable!");
|
||||
|
||||
foreach (var obj in enumerateHitObjectsUpTo(hitObject.HitObject.StartTime))
|
||||
|
|
Loading…
Reference in New Issue