mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 13:37:02 +00:00
[10556] Add frand function for random floats with min/max, similar to urand
This commit is contained in:
parent
802e01a494
commit
7d7bb3cfe6
3 changed files with 9 additions and 1 deletions
|
|
@ -36,6 +36,11 @@ uint32 urand (uint32 min, uint32 max)
|
|||
return mtRand->randInt (max - min) + min;
|
||||
}
|
||||
|
||||
float frand (float min, float max)
|
||||
{
|
||||
return mtRand->randExc (max - min) + min;
|
||||
}
|
||||
|
||||
int32 rand32 ()
|
||||
{
|
||||
return mtRand->randInt ();
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ MANGOS_DLL_SPEC int32 irand(int32 min, int32 max);
|
|||
* between max and min should be less than RAND32_MAX. */
|
||||
MANGOS_DLL_SPEC uint32 urand(uint32 min, uint32 max);
|
||||
|
||||
/* Return a random number in the range min..max (inclusive). */
|
||||
MANGOS_DLL_SPEC float frand(float min, float max);
|
||||
|
||||
/* Return a random number in the range 0 .. RAND32_MAX. */
|
||||
MANGOS_DLL_SPEC int32 rand32();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "10555"
|
||||
#define REVISION_NR "10556"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue