mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:12:56 +08:00
Safeguard againts multiple ApplyResult() invocations
This commit is contained in:
parent
73edb87363
commit
d7f9b8045c
@ -469,6 +469,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
/// <param name="application">The callback that applies changes to the <see cref="JudgementResult"/>.</param>
|
||||
protected void ApplyResult(Action<JudgementResult> application)
|
||||
{
|
||||
if (Result.HasResult)
|
||||
throw new InvalidOperationException($"Cannot apply result on a hitobject that already has a result.");
|
||||
|
||||
application?.Invoke(Result);
|
||||
|
||||
if (!Result.HasResult)
|
||||
|
Loading…
Reference in New Issue
Block a user