From 0f9d447f1f9ea52ffaf4cb9f8dea33b303ffd02b Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 26 Jun 2024 16:20:54 +0900 Subject: [PATCH] Truncate break times for legacy beatmap export --- osu.Game/Database/LegacyBeatmapExporter.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Database/LegacyBeatmapExporter.cs b/osu.Game/Database/LegacyBeatmapExporter.cs index 69120ea885..17c2c8c88d 100644 --- a/osu.Game/Database/LegacyBeatmapExporter.cs +++ b/osu.Game/Database/LegacyBeatmapExporter.cs @@ -8,6 +8,7 @@ using System.Text; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Formats; +using osu.Game.Beatmaps.Timing; using osu.Game.IO; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects.Types; @@ -59,9 +60,13 @@ namespace osu.Game.Database // Convert beatmap elements to be compatible with legacy format // So we truncate time and position values to integers, and convert paths with multiple segments to bezier curves + foreach (var controlPoint in playableBeatmap.ControlPointInfo.AllControlPoints) controlPoint.Time = Math.Floor(controlPoint.Time); + for (int i = 0; i < playableBeatmap.Breaks.Count; i++) + playableBeatmap.Breaks[i] = new BreakPeriod(Math.Floor(playableBeatmap.Breaks[i].StartTime), Math.Floor(playableBeatmap.Breaks[i].EndTime)); + foreach (var hitObject in playableBeatmap.HitObjects) { // Truncate end time before truncating start time because end time is dependent on start time