Core/Util: Add a urandms(min,max) helper to make urand(min*IN_MILLISECONDS, max*IN_MILLISECONDS) shorter to write for random time intervals (boss scripts).
This commit is contained in:
1 parent
e266278f7d
commit
c0faee0795
2 files changed
+10
No files matched your search
@@ -58,6 +58,13 @@ uint32 urand(uint32 min, uint32 max)
|
||||
return GetRng()->URandom(min, max);
|
||||
}
|
||||
|
||||
uint32 urandms(uint32 min, uint32 max)
|
||||
{
|
||||
ASSERT(max >= min);
|
||||
ASSERT(INT_MAX/IN_MILLISECONDS >= max);
|
||||
return GetRng()->URandom(min * IN_MILLISECONDS, max * IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
float frand(float min, float max)
|
||||
{
|
||||
ASSERT(max >= min);
|
||||
|
||||
Reference in new issue
Block a user