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

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:
Dean Herbert 2020-11-27 16:31:59 +09:00
parent c0c197501e
commit 18bb0cb45b

View File

@ -263,18 +263,15 @@ namespace osu.Game.Rulesets.Objects.Drawables
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;