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

Fix HOC not propagating DHO results applied on kill

`DrawableHitObject.OnKilled()` calls `UpdateResult()` to clean up a
hitobject's state definitively with regards to the judgement result
before returning the DHO back to the pool.

As it turns out, if a consumer was relying on this code path (as taiko
was in the case of nested strong hit objects), it would not work
properly with pooling, due to `HitObjectContainer` unsubscribing from
`On{New,Revert}Result` *before* calling the DHO's `OnKilled()`.

This in turn would lead to users potentially getting stuck in gameplay,
due to `ScoreProcessor` not receiving all results via that event path.

To resolve, change the call ordering to allow hit result changes applied
in `OnKilled()` to propagate normally.
This commit is contained in:
Bartłomiej Dach 2021-01-20 23:55:54 +01:00
parent 7abe33ad0e
commit 1d9aaac2c2

View File

@ -124,9 +124,11 @@ namespace osu.Game.Rulesets.UI
Debug.Assert(drawableMap.ContainsKey(entry));
var drawable = drawableMap[entry];
// OnKilled can potentially change the hitobject's result, so it needs to run first before unbinding.
drawable.OnKilled();
drawable.OnNewResult -= onNewResult;
drawable.OnRevertResult -= onRevertResult;
drawable.OnKilled();
drawableMap.Remove(entry);