mirror of
https://github.com/osukey/osukey.git
synced 2025-06-09 05:19:11 +09:00
Fix incorrect equality check when TimingPointAt returns a default T
This commit is contained in:
parent
21984ba764
commit
007b343854
@ -5,7 +5,7 @@ using System;
|
|||||||
|
|
||||||
namespace osu.Game.Beatmaps.ControlPoints
|
namespace osu.Game.Beatmaps.ControlPoints
|
||||||
{
|
{
|
||||||
public class ControlPoint : IComparable<ControlPoint>
|
public class ControlPoint : IComparable<ControlPoint>, IEquatable<ControlPoint>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The time at which the control point takes effect.
|
/// The time at which the control point takes effect.
|
||||||
@ -13,5 +13,12 @@ namespace osu.Game.Beatmaps.ControlPoints
|
|||||||
public double Time;
|
public double Time;
|
||||||
|
|
||||||
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
public int CompareTo(ControlPoint other) => Time.CompareTo(other.Time);
|
||||||
|
|
||||||
|
public bool Equals(ControlPoint other)
|
||||||
|
{
|
||||||
|
if (ReferenceEquals(null, other)) return false;
|
||||||
|
if (ReferenceEquals(this, other)) return true;
|
||||||
|
return Time.Equals(other.Time);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,10 +35,12 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
if (Beatmap.Value?.Track == null)
|
var track = Beatmap.Value?.Track;
|
||||||
|
|
||||||
|
if (track == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double currentTrackTime = Beatmap.Value.Track.CurrentTime + EarlyActivationMilliseconds;
|
double currentTrackTime = track.Length > 0 ? track.CurrentTime + EarlyActivationMilliseconds : Clock.CurrentTime;
|
||||||
|
|
||||||
TimingControlPoint timingPoint = Beatmap.Value.Beatmap.ControlPointInfo.TimingPointAt(currentTrackTime);
|
TimingControlPoint timingPoint = Beatmap.Value.Beatmap.ControlPointInfo.TimingPointAt(currentTrackTime);
|
||||||
EffectControlPoint effectPoint = Beatmap.Value.Beatmap.ControlPointInfo.EffectPointAt(currentTrackTime);
|
EffectControlPoint effectPoint = Beatmap.Value.Beatmap.ControlPointInfo.EffectPointAt(currentTrackTime);
|
||||||
@ -58,7 +60,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
TimeSinceLastBeat = timingPoint.BeatLength - TimeUntilNextBeat;
|
TimeSinceLastBeat = timingPoint.BeatLength - TimeUntilNextBeat;
|
||||||
|
|
||||||
if (timingPoint == lastTimingPoint && beatIndex == lastBeat)
|
if (timingPoint.Equals(lastTimingPoint) && beatIndex == lastBeat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
using (BeginDelayedSequence(-TimeSinceLastBeat, true))
|
using (BeginDelayedSequence(-TimeSinceLastBeat, true))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user