mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Merge pull request #12235 from smoogipoo/fix-never-ending-mania
Fix mania beatmaps sometimes never ending
This commit is contained in:
commit
f46fae9ec6
@ -288,17 +288,56 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
.All(j => j.Type.IsHit()));
|
.All(j => j.Type.IsHit()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestHitTailBeforeLastTick()
|
||||||
|
{
|
||||||
|
const int tick_rate = 8;
|
||||||
|
const double tick_spacing = TimingControlPoint.DEFAULT_BEAT_LENGTH / tick_rate;
|
||||||
|
const double time_last_tick = time_head + tick_spacing * (int)((time_tail - time_head) / tick_spacing - 1);
|
||||||
|
|
||||||
|
var beatmap = new Beatmap<ManiaHitObject>
|
||||||
|
{
|
||||||
|
HitObjects =
|
||||||
|
{
|
||||||
|
new HoldNote
|
||||||
|
{
|
||||||
|
StartTime = time_head,
|
||||||
|
Duration = time_tail - time_head,
|
||||||
|
Column = 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
BeatmapInfo =
|
||||||
|
{
|
||||||
|
BaseDifficulty = new BeatmapDifficulty { SliderTickRate = tick_rate },
|
||||||
|
Ruleset = new ManiaRuleset().RulesetInfo
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
performTest(new List<ReplayFrame>
|
||||||
|
{
|
||||||
|
new ManiaReplayFrame(time_head, ManiaAction.Key1),
|
||||||
|
new ManiaReplayFrame(time_last_tick - 5)
|
||||||
|
}, beatmap);
|
||||||
|
|
||||||
|
assertHeadJudgement(HitResult.Perfect);
|
||||||
|
assertLastTickJudgement(HitResult.LargeTickMiss);
|
||||||
|
assertTailJudgement(HitResult.Ok);
|
||||||
|
}
|
||||||
|
|
||||||
private void assertHeadJudgement(HitResult result)
|
private void assertHeadJudgement(HitResult result)
|
||||||
=> AddAssert($"head judged as {result}", () => judgementResults[0].Type == result);
|
=> AddAssert($"head judged as {result}", () => judgementResults.First(j => j.HitObject is Note).Type == result);
|
||||||
|
|
||||||
private void assertTailJudgement(HitResult result)
|
private void assertTailJudgement(HitResult result)
|
||||||
=> AddAssert($"tail judged as {result}", () => judgementResults[^2].Type == result);
|
=> AddAssert($"tail judged as {result}", () => judgementResults.Single(j => j.HitObject is TailNote).Type == result);
|
||||||
|
|
||||||
private void assertNoteJudgement(HitResult result)
|
private void assertNoteJudgement(HitResult result)
|
||||||
=> AddAssert($"hold note judged as {result}", () => judgementResults[^1].Type == result);
|
=> AddAssert($"hold note judged as {result}", () => judgementResults.Single(j => j.HitObject is HoldNote).Type == result);
|
||||||
|
|
||||||
private void assertTickJudgement(HitResult result)
|
private void assertTickJudgement(HitResult result)
|
||||||
=> AddAssert($"tick judged as {result}", () => judgementResults[6].Type == result); // arbitrary tick
|
=> AddAssert($"any tick judged as {result}", () => judgementResults.Where(j => j.HitObject is HoldNoteTick).Any(j => j.Type == result));
|
||||||
|
|
||||||
|
private void assertLastTickJudgement(HitResult result)
|
||||||
|
=> AddAssert($"last tick judged as {result}", () => judgementResults.Last(j => j.HitObject is HoldNoteTick).Type == result);
|
||||||
|
|
||||||
private ScoreAccessibleReplayPlayer currentPlayer;
|
private ScoreAccessibleReplayPlayer currentPlayer;
|
||||||
|
|
||||||
|
@ -233,6 +233,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|||||||
{
|
{
|
||||||
if (Tail.AllJudged)
|
if (Tail.AllJudged)
|
||||||
{
|
{
|
||||||
|
foreach (var tick in tickContainer)
|
||||||
|
{
|
||||||
|
if (!tick.Judged)
|
||||||
|
tick.MissForcefully();
|
||||||
|
}
|
||||||
|
|
||||||
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
ApplyResult(r => r.Type = r.Judgement.MaxResult);
|
||||||
endHold();
|
endHold();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user