1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 14:12:55 +08:00

Fix hitobject results not rewinding

This commit is contained in:
smoogipoo 2018-08-14 18:31:32 +09:00
parent 364c0d580a
commit e04b2f4fa9

View File

@ -147,17 +147,15 @@ namespace osu.Game.Rulesets.Objects.Drawables
/// </summary>
public void PlaySamples() => Samples?.Play();
private double lastUpdateTime;
protected override void Update()
{
base.Update();
if (Result != null && lastUpdateTime > Time.Current)
if (Result != null && Result.HasResult)
{
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
if (Result.TimeOffset + endTime < Time.Current)
if (Result.TimeOffset + endTime > Time.Current)
{
OnRevertResult?.Invoke(this, Result);
@ -165,8 +163,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
State.Value = ArmedState.Idle;
}
}
lastUpdateTime = Time.Current;
}
protected override void UpdateAfterChildren()