1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 23:57:25 +08:00

Fix judgement offsets being zero when windows are empty

This commit is contained in:
Dean Herbert 2020-11-05 18:58:37 +09:00
parent 3ec813da03
commit a0b3379909

View File

@ -546,7 +546,11 @@ namespace osu.Game.Rulesets.Objects.Drawables
// Ensure that the judgement is given a valid time offset, because this may not get set by the caller // Ensure that the judgement is given a valid time offset, because this may not get set by the caller
var endTime = HitObject.GetEndTime(); var endTime = HitObject.GetEndTime();
Result.TimeOffset = Math.Min(HitObject.HitWindows.WindowFor(HitResult.Miss), Time.Current - endTime); Result.TimeOffset = Time.Current - endTime;
double missWindow = HitObject.HitWindows.WindowFor(HitResult.Miss);
if (missWindow > 0)
Result.TimeOffset = Math.Min(Result.TimeOffset, missWindow);
if (Result.HasResult) if (Result.HasResult)
updateState(Result.IsHit ? ArmedState.Hit : ArmedState.Miss); updateState(Result.IsHit ? ArmedState.Hit : ArmedState.Miss);