1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:23:22 +08:00

Fix NullPointerReference

This commit is contained in:
vun 2022-06-01 04:33:37 +08:00
parent 86ffa810a9
commit 8bbe70bff0

View File

@ -2,8 +2,6 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets.Difficulty.Preprocessing; using osu.Game.Rulesets.Difficulty.Preprocessing;
using osu.Game.Rulesets.Difficulty.Skills;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing; using osu.Game.Rulesets.Taiko.Difficulty.Preprocessing;
using osu.Game.Rulesets.Taiko.Objects; using osu.Game.Rulesets.Taiko.Objects;
@ -42,19 +40,14 @@ namespace osu.Game.Rulesets.Taiko.Difficulty.Evaluators
do do
{ {
previous = (TaikoDifficultyHitObject)previous.Previous(1); previous = (TaikoDifficultyHitObject)previous.Previous(1);
if (previous == null) return 0; // No previous (The note is the first press of the current key)
if (previous.BaseObject is Hit && previous.HitType == taikoCurrent.HitType) if (previous.BaseObject is Hit && previous.HitType == taikoCurrent.HitType)
{ {
--monoNoteInterval; --monoNoteInterval;
} }
currentKeyInterval += previous.DeltaTime; currentKeyInterval += previous.DeltaTime;
} while (previous != null && monoNoteInterval > 0); } while (monoNoteInterval > 0);
// This note is the first press of the current key
if (monoNoteInterval > 0)
{
return 0;
}
double objectStrain = 0.5; double objectStrain = 0.5;
objectStrain += speedBonus(currentKeyInterval); objectStrain += speedBonus(currentKeyInterval);