1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 21:23:04 +08:00

Invert if statements.

This commit is contained in:
smoogipooo 2017-05-22 16:56:40 +09:00
parent 07d148f708
commit abe9c464a8

View File

@ -20,14 +20,16 @@ namespace osu.Game.Graphics.Containers
protected override void Update() protected override void Update()
{ {
if (beatmap.Value != null) if (beatmap.Value == null)
{ return;
double trackCurrentTime = beatmap.Value.Track.CurrentTime; double trackCurrentTime = beatmap.Value.Track.CurrentTime;
ControlPoint kiaiControlPoint; ControlPoint kiaiControlPoint;
ControlPoint controlPoint = beatmap.Value.Beatmap.TimingInfo.TimingPointAt(trackCurrentTime, out kiaiControlPoint); ControlPoint controlPoint = beatmap.Value.Beatmap.TimingInfo.TimingPointAt(trackCurrentTime, out kiaiControlPoint);
if (controlPoint != null) if (controlPoint == null)
{ return;
double beatLength = controlPoint.BeatLength; double beatLength = controlPoint.BeatLength;
bool kiai = kiaiControlPoint?.KiaiMode ?? false; bool kiai = kiaiControlPoint?.KiaiMode ?? false;
double timingPointStart = controlPoint.Time; double timingPointStart = controlPoint.Time;
@ -42,8 +44,6 @@ namespace osu.Game.Graphics.Containers
lastBeat = beat; lastBeat = beat;
lastTimingPointStart = timingPointStart; lastTimingPointStart = timingPointStart;
} }
}
}
protected virtual void OnNewBeat(int newBeat, double beatLength, TimeSignatures timeSignature, bool kiai) protected virtual void OnNewBeat(int newBeat, double beatLength, TimeSignatures timeSignature, bool kiai)
{ {