1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-21 02:19:55 +08:00

Fix slider samples playing twice when additions are present

This commit is contained in:
Dean Herbert
2018-01-18 19:50:26 +09:00
Unverified
parent 754f3216ab
commit b4f2bea37b
+13 -6
View File
@@ -61,6 +61,7 @@ namespace osu.Game.Rulesets.Osu.Objects
public int RepeatCount { get; set; } = 1;
private int stackHeight;
public override int StackHeight
{
get { return stackHeight; }
@@ -130,6 +131,17 @@ namespace osu.Game.Rulesets.Osu.Objects
var distanceProgress = d / length;
var timeProgress = reversed ? 1 - distanceProgress : distanceProgress;
var firstSample = Samples.FirstOrDefault();
var sampleList = new List<SampleInfo>();
if (firstSample != null)
sampleList.Add(new SampleInfo
{
Bank = firstSample?.Bank,
Volume = firstSample?.Volume ?? 100,
Name = @"slidertick",
});
AddNested(new SliderTick
{
RepeatIndex = repeat,
@@ -138,12 +150,7 @@ namespace osu.Game.Rulesets.Osu.Objects
StackHeight = StackHeight,
Scale = Scale,
ComboColour = ComboColour,
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
{
Bank = s.Bank,
Name = @"slidertick",
Volume = s.Volume
}))
Samples = sampleList
});
}
}