1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 10:33:07 +08:00

Fix wrong code

This commit is contained in:
ekrctb 2021-06-01 14:38:02 +09:00
parent 977d44df87
commit 0f381f7758
2 changed files with 5 additions and 3 deletions

View File

@ -117,12 +117,14 @@ namespace osu.Game.Tests.Gameplay
AddStep("Modify start time", () => entry.HitObject.StartTime = 100);
AddAssert("Drawable lifetime is correct", () => dho.LifetimeStart == double.MinValue);
AddStep("Set LifetimeStart", () => dho.LifetimeStart = 666);
AddAssert("Lifetime change is blocked", () => dho.LifetimeStart == double.MinValue);
AddStep("Set LifetimeEnd", () => dho.LifetimeEnd = 999);
AddAssert("Lifetime change is blocked", () => dho.LifetimeEnd == double.MaxValue);
AddStep("KeepAlive = false", () => entry.KeepAlive = false);
AddAssert("Drawable lifetime is restored", () =>
dho.LifetimeStart == 100 - TestLifetimeEntry.INITIAL_LIFETIME_OFFSET && dho.LifetimeEnd == 999);
AddAssert("Drawable lifetime is restored", () => dho.LifetimeStart == 666 && dho.LifetimeEnd == 999);
}
private class TestDrawableHitObject : DrawableHitObject

View File

@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Objects.Pooling
// Cannot write it as `base.LifetimeStart = Entry.LifetimeStart = value` because the change may be blocked (when `HitObjectLifetimeEntry.KeepAlive` is true).
Entry.LifetimeStart = value;
base.LifetimeStart = Entry.LifetimeStart = value;
base.LifetimeStart = Entry.LifetimeStart;
}
}