Merge pull request #1328 from GarageGames/release-3.7

Release 3.7
This commit is contained in:
Daniel Buckmaster 2015-06-24 19:00:57 +10:00
commit 39f0e269d6
48 changed files with 317 additions and 102 deletions

View file

@ -1019,7 +1019,7 @@ F32 mRandF()
return gRandGen.randF();
}
DefineConsoleFunction( getRandom, F32, (S32 a, S32 b), (1, 0),
DefineConsoleFunction(getRandom, F32, (S32 a, S32 b), (S32_MAX, S32_MAX),
"( int a, int b ) "
"@brief Returns a random number based on parameters passed in..\n\n"
"If no parameters are passed in, getRandom() will return a float between 0.0 and 1.0. If one "
@ -1033,21 +1033,21 @@ DefineConsoleFunction( getRandom, F32, (S32 a, S32 b), (1, 0),
"@see setRandomSeed\n"
"@ingroup Random" )
{
if (b == 0)
return F32(gRandGen.randI(0,getMax( a, 0 )));
else
if (a != S32_MAX)
{
if (b != 0)
if (b == S32_MAX)
return F32(gRandGen.randI(0, getMax(a, 0)));
else
{
S32 min = a;
S32 max = b;
if (min > max)
if (min > max)
{
S32 t = min;
min = max;
max = t;
}
return F32(gRandGen.randI(min,max));
return F32(gRandGen.randI(min, max));
}
}
return gRandGen.randF();