mirror of
https://github.com/ppy/osu
synced 2024-12-26 08:53:10 +00:00
Ensure RNG max value cannot go below min value
This commit is contained in:
parent
003e36862f
commit
8f0440d14c
@ -77,7 +77,7 @@ namespace osu.Game.Rulesets.Catch.Mods
|
||||
private void applyRandomOffset(ref float position, double maxOffset)
|
||||
{
|
||||
bool right = RNG.NextBool();
|
||||
float rand = Math.Min(20, (float)RNG.NextDouble(0, maxOffset)) / CatchPlayfield.BASE_WIDTH;
|
||||
float rand = Math.Min(20, (float)RNG.NextDouble(0, Math.Max(0, maxOffset))) / CatchPlayfield.BASE_WIDTH;
|
||||
|
||||
if (right)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user