From 0303955de32876860bea8ed0db31f398d73c2073 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Sat, 10 Aug 2019 10:44:19 +0300 Subject: More CCarCtrl --- src/core/General.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/General.h b/src/core/General.h index 7c0c9562..351243be 100644 --- a/src/core/General.h +++ b/src/core/General.h @@ -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)); } -- cgit v1.2.3