1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:22:56 +08:00

Clamp juice stream position

This commit is contained in:
ekrctb 2018-06-20 17:23:55 +09:00
parent 2ff7b4cdcf
commit 9d7e5b4920
2 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
foreach (var nested in juiceStream.NestedHitObjects)
{
if (nested is TinyDroplet tinyDroplet)
tinyDroplet.X += rng.Next(-20, 20) / CatchPlayfield.BASE_WIDTH;
tinyDroplet.X = MathHelper.Clamp(tinyDroplet.X + rng.Next(-20, 20) / CatchPlayfield.BASE_WIDTH, 0, 1);
else if (nested is Droplet)
rng.Next(); // osu!stable retrieved a random droplet rotation
}

View File

@ -89,7 +89,7 @@ namespace osu.Game.Rulesets.Catch.Objects
AddNested(new TinyDroplet
{
StartTime = t,
X = X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH,
X = MathHelper.Clamp(X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH, 0, 1),
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
{
Bank = s.Bank,
@ -104,7 +104,7 @@ namespace osu.Game.Rulesets.Catch.Objects
AddNested(new Droplet
{
StartTime = time,
X = X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH,
X = MathHelper.Clamp(X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH, 0, 1),
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
{
Bank = s.Bank,
@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Catch.Objects
{
Samples = Samples,
StartTime = spanStartTime + spanDuration,
X = X + Curve.PositionAt(reversed ? 0 : 1).X / CatchPlayfield.BASE_WIDTH
X = MathHelper.Clamp(X + Curve.PositionAt(reversed ? 0 : 1).X / CatchPlayfield.BASE_WIDTH, 0, 1)
});
}