1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 07:42:57 +08:00

truncate end time before start time

This commit is contained in:
OliBomby 2023-07-18 12:28:35 +02:00
parent 5d82190b70
commit bcdf531039

View File

@ -58,10 +58,11 @@ namespace osu.Game.Database
foreach (var hitObject in beatmapContent.HitObjects)
{
hitObject.StartTime = Math.Floor(hitObject.StartTime);
// Truncate end time before truncating start time because end time is dependent on start time
if (hitObject is IHasDuration hasDuration && hitObject is not IHasPath)
hasDuration.Duration = Math.Floor(hasDuration.Duration);
hasDuration.Duration = Math.Floor(hasDuration.EndTime) - Math.Floor(hitObject.StartTime);
hitObject.StartTime = Math.Floor(hitObject.StartTime);
if (hitObject is not IHasPath hasPath || BezierConverter.CountSegments(hasPath.Path.ControlPoints) <= 1) continue;