mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 02:33:02 +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>
|
/// <param name="application">The callback that applies changes to the <see cref="JudgementResult"/>.</param>
|
||||||
protected void ApplyResult(Action<JudgementResult> application)
|
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);
|
application?.Invoke(Result);
|
||||||
|
|
||||||
if (!Result.HasResult)
|
if (!Result.HasResult)
|
||||||
|
Loading…
Reference in New Issue
Block a user