1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 04:13:11 +08:00

Allow non-pooled DHO to be reused

This commit is contained in:
ekrctb 2020-11-26 19:07:09 +09:00
parent f3f5ec7665
commit 05e245d445

View File

@ -135,10 +135,8 @@ namespace osu.Game.Rulesets.UI
/// <param name="h">The DrawableHitObject to add.</param> /// <param name="h">The DrawableHitObject to add.</param>
public virtual void Add(DrawableHitObject h) public virtual void Add(DrawableHitObject h)
{ {
if (h.IsInitialized) if (!h.IsInitialized)
throw new InvalidOperationException($"{nameof(Add)} doesn't support {nameof(DrawableHitObject)} reuse. Use pooling instead."); onNewDrawableHitObject(h);
onNewDrawableHitObject(h);
HitObjectContainer.Add(h); HitObjectContainer.Add(h);
OnHitObjectAdded(h.HitObject); OnHitObjectAdded(h.HitObject);