Ensure RNG max value cannot go below min value

This commit is contained in:
smoogipoo 2019-03-20 12:06:37 +09:00
parent 003e36862f
commit 8f0440d14c

View File

@ -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)
{