Merge pull request #3222 from smoogipoo/fix-rewinding

Fix hitobject results not rewinding
This commit is contained in:
Dean Herbert 2018-08-15 09:07:31 +09:00 committed by GitHub
commit 7bb22ce2b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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()