1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 06:23:20 +08:00

Merge pull request #11066 from ekrctb/fix-sample-expire

Fix DrawableHitObjects potentially expiring before their hit samples finish playback
This commit is contained in:
Dean Herbert 2020-12-04 21:52:36 +09:00 committed by GitHub
commit 9064ca9064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -451,7 +451,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
state.Value = newState; state.Value = newState;
if (LifetimeEnd == double.MaxValue && (state.Value != ArmedState.Idle || HitObject.HitWindows == null)) if (LifetimeEnd == double.MaxValue && (state.Value != ArmedState.Idle || HitObject.HitWindows == null))
Expire(); LifetimeEnd = Math.Max(LatestTransformEndTime, HitStateUpdateTime + (Samples?.Length ?? 0));
// apply any custom state overrides // apply any custom state overrides
ApplyCustomUpdateState?.Invoke(this, newState); ApplyCustomUpdateState?.Invoke(this, newState);

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations; using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -13,6 +14,8 @@ namespace osu.Game.Skinning
{ {
public class PausableSkinnableSound : SkinnableSound public class PausableSkinnableSound : SkinnableSound
{ {
public double Length => !DrawableSamples.Any() ? 0 : DrawableSamples.Max(sample => sample.Length);
protected bool RequestedPlaying { get; private set; } protected bool RequestedPlaying { get; private set; }
public PausableSkinnableSound() public PausableSkinnableSound()