1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Fix DHO expires while hit sound is playing

This commit is contained in:
ekrctb 2020-12-03 12:32:49 +09:00
parent 6c41830d4d
commit 6c46046c24
2 changed files with 4 additions and 1 deletions

View File

@ -453,7 +453,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);

View File

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