mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:02:58 +08:00
Clamp juice stream position
This commit is contained in:
parent
2ff7b4cdcf
commit
9d7e5b4920
@ -57,7 +57,7 @@ namespace osu.Game.Rulesets.Catch.Beatmaps
|
|||||||
foreach (var nested in juiceStream.NestedHitObjects)
|
foreach (var nested in juiceStream.NestedHitObjects)
|
||||||
{
|
{
|
||||||
if (nested is TinyDroplet tinyDroplet)
|
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)
|
else if (nested is Droplet)
|
||||||
rng.Next(); // osu!stable retrieved a random droplet rotation
|
rng.Next(); // osu!stable retrieved a random droplet rotation
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
AddNested(new TinyDroplet
|
AddNested(new TinyDroplet
|
||||||
{
|
{
|
||||||
StartTime = t,
|
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
|
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||||
{
|
{
|
||||||
Bank = s.Bank,
|
Bank = s.Bank,
|
||||||
@ -104,7 +104,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
AddNested(new Droplet
|
AddNested(new Droplet
|
||||||
{
|
{
|
||||||
StartTime = time,
|
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
|
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||||
{
|
{
|
||||||
Bank = s.Bank,
|
Bank = s.Bank,
|
||||||
@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
{
|
{
|
||||||
Samples = Samples,
|
Samples = Samples,
|
||||||
StartTime = spanStartTime + spanDuration,
|
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)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user