mirror of https://github.com/ppy/osu
Remove unnecessary schedule logic from Apply's local updateState call
There were cases in the editor where rewinding of transforms would leave the `DrawableHitObject` in a non-`IsPresent` state, resulting in this scheduled logic never running. This would in turn cause ghost hitobjects, which disappear under certain circumstances. Reproduction: - Open editor to empty beatmap - Place single hitcircle at current point in time - Drag editor timeline backwards to seek before zero, and wait for return to zero - Select hitcircle in playfield - Drag hitcircle to right in timeline, triggering a start time change
This commit is contained in:
parent
c0c197501e
commit
18bb0cb45b
|
@ -263,18 +263,15 @@ public void Apply([NotNull] HitObject hitObject, [CanBeNull] HitObjectLifetimeEn
|
|||
OnApply();
|
||||
HitObjectApplied?.Invoke(this);
|
||||
|
||||
// If not loaded, the state update happens in LoadComplete(). Otherwise, the update is scheduled to allow for lifetime updates.
|
||||
// If not loaded, the state update happens in LoadComplete().
|
||||
if (IsLoaded)
|
||||
{
|
||||
Scheduler.Add(() =>
|
||||
{
|
||||
if (Result.IsHit)
|
||||
updateState(ArmedState.Hit, true);
|
||||
else if (Result.HasResult)
|
||||
updateState(ArmedState.Miss, true);
|
||||
else
|
||||
updateState(ArmedState.Idle, true);
|
||||
});
|
||||
if (Result.IsHit)
|
||||
updateState(ArmedState.Hit, true);
|
||||
else if (Result.HasResult)
|
||||
updateState(ArmedState.Miss, true);
|
||||
else
|
||||
updateState(ArmedState.Idle, true);
|
||||
}
|
||||
|
||||
hasHitObjectApplied = true;
|
||||
|
|
Loading…
Reference in New Issue