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

Fix invalid cast

Since introduction of IgnoreJudgement and its usage in JuiceStream
and BananaShower the hard cast in CatcherArea that was used to check
if the drawable hit object should cause the fruits on the plate explode
at the end of combo caused a hard crash instead, since IgnoreJudgement
was no longer deriving from CatchJudgement.

Replace the hard cast with a soft pattern-matched cast.
This commit is contained in:
Bartłomiej Dach 2020-02-25 23:13:32 +01:00
parent 88ec31c262
commit bf36dc10a5

View File

@ -89,7 +89,7 @@ namespace osu.Game.Rulesets.Catch.UI
if (fruit.HitObject.LastInCombo)
{
if (((CatchJudgement)result.Judgement).ShouldExplodeFor(result))
if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result))
runAfterLoaded(() => MovableCatcher.Explode());
else
MovableCatcher.Drop();