mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09: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)
|
private void applyRandomOffset(ref float position, double maxOffset)
|
||||||
{
|
{
|
||||||
bool right = RNG.NextBool();
|
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)
|
if (right)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user