1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Fix distance object conversion not calculating end time.

This commit is contained in:
smoogipooo 2017-05-18 14:08:32 +09:00
parent 6010243736
commit 6dae5cbacf

View File

@ -17,6 +17,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
{
internal class DistanceObjectConversion : ObjectConversion
{
/// <summary>
/// Base osu! slider scoring distance.
/// </summary>
private const float osu_base_scoring_distance = 100;
private readonly HitObject originalObject;
private readonly double endTime;
@ -39,8 +44,20 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
var distanceData = originalObject as IHasDistance;
var repeatsData = originalObject as IHasRepeats;
endTime = distanceData?.EndTime ?? 0;
repeatCount = repeatsData?.RepeatCount ?? 1;
double speedAdjustment = beatmap.TimingInfo.SpeedMultiplierAt(originalObject.StartTime);
double speedAdjustedBeatLength = beatmap.TimingInfo.BeatLengthAt(originalObject.StartTime) * speedAdjustment;
// The true distance, accounting for any repeats. This ends up being the drum roll distance later
double distance = distanceData.Distance * repeatCount;
// The velocity of the osu! hit object - calculated as the velocity of a slider
double osuVelocity = osu_base_scoring_distance * beatmap.BeatmapInfo.Difficulty.SliderMultiplier / speedAdjustedBeatLength;
// The duration of the osu! hit object
double osuDuration = distance / osuVelocity;
endTime = originalObject.StartTime + osuDuration;
}
public override ObjectList Generate()