Merge pull request #10317 from smoogipoo/protect-multiple-applyresult

Safeguard againts multiple ApplyResult() invocations
This commit is contained in:
Dean Herbert
2020-10-01 22:22:26 +09:00
committed by GitHub

View File

@ -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)