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:
commit
9064ca9064
@ -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);
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user