Fix RecreatePieces being called more than once

This commit is contained in:
Dean Herbert 2021-05-21 16:10:48 +09:00
parent 40c8378d81
commit a5ca736e37

View File

@ -52,15 +52,18 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected override void OnApply() protected override void OnApply()
{ {
type.BindTo(HitObject.TypeBindable); type.BindTo(HitObject.TypeBindable);
type.BindValueChanged(_ => // this doesn't need to be run inline as RecreatePieces is called by the base call below.
{ type.BindValueChanged(_ => RecreatePieces());
updateActionsFromType();
RecreatePieces();
}, true);
base.OnApply(); base.OnApply();
} }
protected override void RecreatePieces()
{
updateActionsFromType();
base.RecreatePieces();
}
protected override void OnFree() protected override void OnFree()
{ {
base.OnFree(); base.OnFree();