proper nextdouble

direct randombool
thread safe parallelized timer changes
This commit is contained in:
Mark Sturgill 2013-10-13 19:27:25 -07:00
parent 41019b691b
commit b3831721d9
3 changed files with 163 additions and 84 deletions

View file

@ -789,7 +789,7 @@ namespace Server
public static bool RandomBool()
{
return (RandomImpl.Next(2) == 0);
return RandomImpl.NextBool();
}
public static int RandomMinMax( int min, int max )
@ -810,16 +810,11 @@ namespace Server
public static int Random( int from, int count )
{
if ( count == 0 )
{
if ( count == 0 ) {
return from;
}
else if ( count > 0 )
{
} else if ( count > 0 ) {
return from + RandomImpl.Next(count);
}
else
{
} else {
return from - RandomImpl.Next(-count);
}
}