fix: Fixes .net 6 compilation (#860)

This commit is contained in:
Kamron Batman 2021-11-21 18:06:39 -08:00 committed by GitHub
parent c8043e8dd2
commit c8a6d4c696
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 17 deletions

View file

@ -1049,6 +1049,21 @@ namespace Server
return min + (int)RandomSources.Source.Next((uint)(max - min + 1));
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static long RandomMinMax(long min, long max)
{
if (min > max)
{
(min, max) = (max, min);
}
else if (min == max)
{
return min;
}
return min + RandomSources.Source.Next(max - min + 1);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int Random(int from, int count) => RandomSources.Source.Next(from, count);