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:
commit
c440d89ef9
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user