-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24233 from chayleaf/fix-taiko-maps-not-finishing
Fix taiko maps sporadically not completing with Hidden mod active
- Loading branch information
Showing
7 changed files
with
95 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// 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; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using NUnit.Framework; | ||
|
@@ -10,6 +11,7 @@ | |
using osu.Game.Beatmaps.ControlPoints; | ||
using osu.Game.Replays; | ||
using osu.Game.Rulesets.Judgements; | ||
using osu.Game.Rulesets.Mods; | ||
using osu.Game.Rulesets.Replays; | ||
using osu.Game.Rulesets.Scoring; | ||
using osu.Game.Rulesets.Taiko.Objects; | ||
|
@@ -36,11 +38,12 @@ protected void AssertResult<T>(int index, HitResult expectedResult) | |
() => Is.EqualTo(expectedResult)); | ||
} | ||
|
||
protected void PerformTest(List<ReplayFrame> frames, Beatmap<TaikoHitObject>? beatmap = null) | ||
protected void PerformTest(List<ReplayFrame> frames, Beatmap<TaikoHitObject>? beatmap = null, Mod[]? mods = null) | ||
{ | ||
AddStep("load player", () => | ||
{ | ||
Beatmap.Value = CreateWorkingBeatmap(beatmap); | ||
SelectedMods.Value = mods ?? Array.Empty<Mod>(); | ||
|
||
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } }); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// 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 osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Taiko.Judgements; | ||
|
||
namespace osu.Game.Rulesets.Taiko.Objects.Drawables | ||
|
@@ -16,5 +17,17 @@ protected DrawableStrongNestedHit(StrongNestedHitObject? nestedHit) | |
: base(nestedHit) | ||
{ | ||
} | ||
|
||
public override void OnKilled() | ||
{ | ||
base.OnKilled(); | ||
|
||
// usually, the strong nested hit isn't judged itself, it is judged by its parent object. | ||
// however, in rare cases (see: drum rolls, hits with hidden active), | ||
// it can happen that the hit window of the nested strong hit extends past the lifetime of the parent object. | ||
// this is a safety to prevent such cases from causing the nested hit to never be judged and as such prevent gameplay from completing. | ||
if (!Judged && Time.Current > ParentHitObject?.HitObject.GetEndTime()) | ||
ApplyResult(r => r.Type = r.Judgement.MinResult); | ||
} | ||
} | ||
} |