1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Revert "Fix wrong InitialLifetimeOffset is used for a non-pooled DHO."

This reverts commit 67fcfd9d
This commit is contained in:
ekrctb 2021-04-21 10:02:50 +09:00
parent 67fcfd9dbc
commit 44ff08cce4
3 changed files with 6 additions and 13 deletions

View File

@ -172,7 +172,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
{
if (initialHitObject != null)
{
lifetimeEntry = new SyntheticHitObjectEntry(initialHitObject, initialHitObject.StartTime - InitialLifetimeOffset);
lifetimeEntry = new SyntheticHitObjectEntry(initialHitObject);
ensureEntryHasResult();
}
}
@ -227,7 +227,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
if (hitObject == null)
throw new ArgumentNullException($"Cannot apply a null {nameof(HitObject)}.");
Apply(new SyntheticHitObjectEntry(hitObject, hitObject.StartTime - InitialLifetimeOffset));
Apply(new SyntheticHitObjectEntry(hitObject));
}
/// <summary>

View File

@ -30,17 +30,12 @@ namespace osu.Game.Rulesets.Objects
/// Creates a new <see cref="HitObjectLifetimeEntry"/>.
/// </summary>
/// <param name="hitObject">The <see cref="HitObject"/> to store the lifetime of.</param>
/// <param name="lifetimeStart">The <see cref="LifetimeStart"/>.</param>
/// <param name="lifetimeEnd">The <see cref="LifetimeEnd"/>.</param>
public HitObjectLifetimeEntry(HitObject hitObject, double lifetimeStart = double.MinValue, double lifetimeEnd = double.MaxValue)
public HitObjectLifetimeEntry(HitObject hitObject)
{
HitObject = hitObject;
startTimeBindable.BindTo(HitObject.StartTimeBindable);
// Only set initial lifetime if it is not provided
startTimeBindable.BindValueChanged(onStartTimeChanged, lifetimeStart == double.MinValue);
setLifetime(lifetimeStart, lifetimeEnd);
startTimeBindable.BindValueChanged(onStartTimeChanged, true);
}
// The lifetime start, as set by the hitobject.

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable enable
using osu.Game.Rulesets.Objects.Drawables;
namespace osu.Game.Rulesets.Objects
@ -13,8 +11,8 @@ namespace osu.Game.Rulesets.Objects
/// </summary>
internal class SyntheticHitObjectEntry : HitObjectLifetimeEntry
{
public SyntheticHitObjectEntry(HitObject hitObject, double initialLifetimeStart)
: base(hitObject, initialLifetimeStart)
public SyntheticHitObjectEntry(HitObject hitObject)
: base(hitObject)
{
}
}