1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Move validation to DHO.ApplyResult()

This commit is contained in:
Dan Balasescu 2023-10-10 21:42:37 +09:00
parent 18d20cad8b
commit a1a46e58fc
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -672,6 +672,8 @@ namespace osu.Game.Rulesets.Objects.Drawables
if (!Result.HasResult)
throw new InvalidOperationException($"{GetType().ReadableName()} applied a {nameof(JudgementResult)} but did not update {nameof(JudgementResult.Type)}.");
HitResultExtensions.ValidateHitResultPair(Result.Judgement.MaxResult, Result.Judgement.MinResult);
if (!Result.Type.IsValidHitResult(Result.Judgement.MinResult, Result.Judgement.MaxResult))
{
throw new InvalidOperationException(

View File

@ -151,8 +151,6 @@ namespace osu.Game.Rulesets.Scoring
{
var judgement = obj.CreateJudgement();
HitResultExtensions.ValidateHitResultPair(judgement.MaxResult, judgement.MinResult);
var result = CreateResult(obj, judgement);
if (result == null)
throw new InvalidOperationException($"{GetType().ReadableName()} must provide a {nameof(JudgementResult)} through {nameof(CreateResult)}.");