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:
treeston committed 2015-11-28 23:53:04 +01:00
1 parent e266278f7d
commit c0faee0795
2 files changed
+10

No files matched your search

+7
View File
@@ -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);