More CCarCtrl

This commit is contained in:
Nikolay Korolev
2019-08-10 10:44:19 +03:00
parent 1fa2fe566c
commit 0303955de3
3 changed files with 84 additions and 2 deletions

View File

@ -98,6 +98,8 @@ public:
// not too sure about all these...
static uint16 GetRandomNumber(void)
{ return myrand() & MYRAND_MAX; }
static bool GetRandomTrueFalse(void)
{ return GetRandomNumber() < MYRAND_MAX / 2; }
// Probably don't want to ever reach high
static float GetRandomNumberInRange(float low, float high)
{ return low + (high - low)*(GetRandomNumber()/float(MYRAND_MAX + 1)); }