mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:43:01 +08:00
Fixing null reference exception bugs
This commit is contained in:
parent
871743204b
commit
2e5bc4323a
@ -34,7 +34,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
difficultyHitObjects.Clear();
|
difficultyHitObjects.Clear();
|
||||||
|
|
||||||
float circleSize = Beatmap.BeatmapInfo.BaseDifficulty.CircleSize;
|
float circleSize = Beatmap.BeatmapInfo.BaseDifficulty.CircleSize;
|
||||||
float catcherWidth = (1.0f - 0.7f * (circleSize - 5) / 5) * 0.62064f * CatcherArea.CATCHER_SIZE;
|
float catcherWidth = ((1.0f - 0.7f * (circleSize - 5) / 5) * 0.62064f) * CatcherArea.CATCHER_SIZE;
|
||||||
float catcherWidthHalf = catcherWidth / 2;
|
float catcherWidthHalf = catcherWidth / 2;
|
||||||
catcherWidthHalf *= 0.8f;
|
catcherWidthHalf *= 0.8f;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
double ar = Beatmap.BeatmapInfo.BaseDifficulty.ApproachRate;
|
double ar = Beatmap.BeatmapInfo.BaseDifficulty.ApproachRate;
|
||||||
double preEmpt = BeatmapDifficulty.DifficultyRange(ar, 1800, 1200, 450) / TimeRate;
|
double preEmpt = BeatmapDifficulty.DifficultyRange(ar, 1800, 1200, 450) / TimeRate;
|
||||||
|
|
||||||
categoryDifficulty["AR"] = preEmpt > 1200.0 ? -(preEmpt - 1800.0) / 120.0 : -(preEmpt - 1200.0) / 150.0 + 5.0;
|
categoryDifficulty["AR"] = (preEmpt > 1200.0) ? -(preEmpt - 1800.0) / 120.0 : (-(preEmpt - 1200.0) / 150.0) + 5.0;
|
||||||
categoryDifficulty["Max combo"] = difficultyHitObjects.Count;
|
categoryDifficulty["Max combo"] = difficultyHitObjects.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,8 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
while (hitObjectsEnumerator.MoveNext())
|
while (hitObjectsEnumerator.MoveNext())
|
||||||
{
|
{
|
||||||
CatchDifficultyHitObject nextHitObject = hitObjectsEnumerator.Current;
|
CatchDifficultyHitObject nextHitObject = hitObjectsEnumerator.Current;
|
||||||
nextHitObject.CalculateStrains(currentHitObject, TimeRate);
|
if (nextHitObject != null)
|
||||||
|
nextHitObject.CalculateStrains(currentHitObject, TimeRate);
|
||||||
currentHitObject = nextHitObject;
|
currentHitObject = nextHitObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
/// The weighting of each strain value decays to this number * it's previous value
|
/// The weighting of each strain value decays to this number * it's previous value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const double decay_weight = 0.94;
|
private const double decay_weight = 0.94;
|
||||||
|
|
||||||
protected double CalculateDifficulty()
|
protected double CalculateDifficulty()
|
||||||
{
|
{
|
||||||
// The strain step needs to be adjusted for the algorithm to be considered equal with speed changing mods
|
// The strain step needs to be adjusted for the algorithm to be considered equal with speed changing mods
|
||||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
{
|
{
|
||||||
internal class CatchDifficultyHitObject
|
internal class CatchDifficultyHitObject
|
||||||
{
|
{
|
||||||
internal static readonly double decay_base = 0.20;
|
internal static readonly double DECAY_BASE = 0.20;
|
||||||
private const float normalized_hitobject_radius = 41.0f;
|
private const float normalized_hitobject_radius = 41.0f;
|
||||||
private const float absolute_player_positioning_error = 16f;
|
private const float absolute_player_positioning_error = 16f;
|
||||||
private readonly float playerPositioningError;
|
private readonly float playerPositioningError;
|
||||||
@ -49,7 +49,7 @@ namespace osu.Game.Rulesets.Catch.Difficulty
|
|||||||
// Rather simple, but more specialized things are inherently inaccurate due to the big difference playstyles and opinions make.
|
// Rather simple, but more specialized things are inherently inaccurate due to the big difference playstyles and opinions make.
|
||||||
// See Taiko feedback thread.
|
// See Taiko feedback thread.
|
||||||
double timeElapsed = (BaseHitObject.StartTime - previousHitObject.BaseHitObject.StartTime) / timeRate;
|
double timeElapsed = (BaseHitObject.StartTime - previousHitObject.BaseHitObject.StartTime) / timeRate;
|
||||||
double decay = Math.Pow(decay_base, timeElapsed / 1000);
|
double decay = Math.Pow(DECAY_BASE, timeElapsed / 1000);
|
||||||
|
|
||||||
// Update new position with lazy movement.
|
// Update new position with lazy movement.
|
||||||
PlayerPositionOffset =
|
PlayerPositionOffset =
|
||||||
|
Loading…
Reference in New Issue
Block a user