mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 02:43:02 +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:
commit
9064ca9064
@ -451,7 +451,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
state.Value = newState;
|
||||
|
||||
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
|
||||
ApplyCustomUpdateState?.Invoke(this, newState);
|
||||
|
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
@ -13,6 +14,8 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
public class PausableSkinnableSound : SkinnableSound
|
||||
{
|
||||
public double Length => !DrawableSamples.Any() ? 0 : DrawableSamples.Max(sample => sample.Length);
|
||||
|
||||
protected bool RequestedPlaying { get; private set; }
|
||||
|
||||
public PausableSkinnableSound()
|
||||
|
Loading…
Reference in New Issue
Block a user