fix: Fixes .net 6 compilation (#860)
This commit is contained in:
parent
c8043e8dd2
commit
c8a6d4c696
7 changed files with 36 additions and 17 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue