fixed rand (thanks nick)

This commit is contained in:
aap 2019-07-04 23:10:04 +02:00
parent bdd5ed6a20
commit d62c616545
3 changed files with 3 additions and 7 deletions

View File

@ -4,10 +4,6 @@ class CGeneral
{
public:
static float GetATanOfXY(float x, float y){
// why exactly doesn't this work?
// if(y >= 0.0f) return atan2(x, y);
// return atan2(x, y) + 2*M_PI;
if(x == 0.0f && y == 0.0f)
return 0.0f;
float xabs = fabs(x);
@ -85,7 +81,7 @@ public:
// not too sure about all these...
static uint16 GetRandomNumber(void)
{ return myrand() & 0xFFFF; }
{ return myrand() & MYRAND_MAX; }
// Probably don't want to ever reach high
static float GetRandomNumberInRange(float low, float high)
{ return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); }

View File

@ -5,4 +5,4 @@ class CStats
public:
static int32 &DaysPassed;
static int32 &HeadShots;
};
};

View File

@ -85,7 +85,7 @@ enum Config {
#elif defined GTA_PC
# define GTA3_1_1_PATCH
# ifdef GTA_PS2_STUFF
# define USE_PS2_RAND
//# define USE_PS2_RAND // this is unsafe until we have the game reversed
# define RANDOMSPLASH // use random splash as on PS2
# define PS2_MATFX
# endif