1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-01 00:53:29 +08:00

Make DrawableHitObject's UpdateState safer by blocking calls at a higher level with not yet loaded.

UpdateState is called in LoadComplete for cases where the state may have changed before a load operation.
This commit is contained in:
Dean Herbert 2017-03-22 09:43:44 +09:00
parent 83d3e37fd4
commit 4f3ab879de
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
6 changed files with 3 additions and 10 deletions

View File

@ -111,8 +111,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
if (!IsLoaded) return;
base.UpdateState(state); base.UpdateState(state);
ApproachCircle.FadeOut(); ApproachCircle.FadeOut();

View File

@ -22,8 +22,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
if (!IsLoaded) return;
Flush(); Flush();
UpdateInitialState(); UpdateInitialState();

View File

@ -158,8 +158,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
if (!IsLoaded) return;
base.UpdateState(state); base.UpdateState(state);
ball.FadeIn(); ball.FadeIn();

View File

@ -95,8 +95,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
if (!IsLoaded) return;
base.UpdateState(state); base.UpdateState(state);
switch (state) switch (state)

View File

@ -134,8 +134,6 @@ namespace osu.Game.Modes.Osu.Objects.Drawables
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
if (!IsLoaded) return;
base.UpdateState(state); base.UpdateState(state);
Delay(spinner.Duration, true); Delay(spinner.Duration, true);

View File

@ -38,6 +38,9 @@ namespace osu.Game.Modes.Objects.Drawables
return; return;
state = value; state = value;
if (!IsLoaded)
return;
UpdateState(state); UpdateState(state);
if (State == ArmedState.Hit) if (State == ArmedState.Hit)