Skip to content

Commit

Permalink
Add 1ms offset to controlpoint lookup times
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Dec 4, 2018
1 parent b0adab5 commit 9fdd48d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions osu.Game/Rulesets/Objects/HitObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ namespace osu.Game.Rulesets.Objects
/// </summary>
public class HitObject
{
/// <summary>
/// A small adjustment to the start time of control points to account for rounding/precision errors.
/// </summary>
private const double control_point_leniency = 1;

/// <summary>
/// The time at which the HitObject starts.
/// </summary>
Expand Down Expand Up @@ -70,7 +75,7 @@ public void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty d
ApplyDefaultsToSelf(controlPointInfo, difficulty);

// This is done here since ApplyDefaultsToSelf may be used to determine the end time
SampleControlPoint = controlPointInfo.SamplePointAt((this as IHasEndTime)?.EndTime ?? StartTime);
SampleControlPoint = controlPointInfo.SamplePointAt(((this as IHasEndTime)?.EndTime ?? StartTime) + control_point_leniency);

nestedHitObjects.Clear();

Expand All @@ -87,7 +92,7 @@ public void ApplyDefaults(ControlPointInfo controlPointInfo, BeatmapDifficulty d

protected virtual void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
{
Kiai = controlPointInfo.EffectPointAt(StartTime).KiaiMode;
Kiai = controlPointInfo.EffectPointAt(StartTime + control_point_leniency).KiaiMode;

if (HitWindows == null)
HitWindows = CreateHitWindows();
Expand Down

0 comments on commit 9fdd48d

Please sign in to comment.