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

Merge pull request #17678 from peppy/get-virtual-time-length

Change `WorkingBeatmap.GetVirtualTrack` to use length provided by `BeatmapInfo`
This commit is contained in:
Dan Balasescu 2022-04-07 09:32:59 +09:00 committed by GitHub
commit c440d89ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,6 @@ using osu.Framework.Logging;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.UI;
using osu.Game.Skinning;
using osu.Game.Storyboards;
@ -152,24 +151,7 @@ namespace osu.Game.Beatmaps
{
const double excess_length = 1000;
var lastObject = Beatmap?.HitObjects.LastOrDefault();
double length;
switch (lastObject)
{
case null:
length = emptyLength;
break;
case IHasDuration endTime:
length = endTime.EndTime + excess_length;
break;
default:
length = lastObject.StartTime + excess_length;
break;
}
double length = (BeatmapInfo?.Length + excess_length) ?? emptyLength;
return audioManager.Tracks.GetVirtual(length);
}