Remove many now unnecessary null-checks

This commit is contained in:
Dean Herbert
2017-07-19 15:45:23 +09:00
parent 21d07428fe
commit 64ebc01a3b
7 changed files with 19 additions and 19 deletions

View File

@ -86,13 +86,15 @@ namespace osu.Game.Screens.Menu
private void updateAmplitudes()
{
float[] temporalAmplitudes = beatmap.Value?.Track?.CurrentAmplitudes.FrequencyAmplitudes ?? new float[256];
var track = beatmap.Value.Track;
var effect = beatmap.Value?.Beatmap.ControlPointInfo.EffectPointAt(beatmap.Value.Track?.CurrentTime ?? Time.Current);
float[] temporalAmplitudes = track?.CurrentAmplitudes.FrequencyAmplitudes ?? new float[256];
var effect = beatmap.Value.Beatmap.ControlPointInfo.EffectPointAt(track?.CurrentTime ?? Time.Current);
for (int i = 0; i < bars_per_visualiser; i++)
{
if (beatmap?.Value?.Track?.IsRunning ?? false)
if (track?.IsRunning ?? false)
{
float targetAmplitude = temporalAmplitudes[(i + indexOffset) % bars_per_visualiser] * (effect?.KiaiMode == true ? 1 : 0.5f);
if (targetAmplitude > frequencyAmplitudes[i])