diff options
author | madmaxoft <github@xoft.cz> | 2013-12-20 16:11:25 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-12-20 16:11:25 +0100 |
commit | b6e4d2c263f25f3724376e72396e28220a0b57e4 (patch) | |
tree | 564cbd7e1cce358c94c78b035e3ba7ee17fa23aa /src | |
parent | Fixed compiler warning when iterating over a fixed array of items (ARRAYCOUNT). (diff) | |
download | cuberite-b6e4d2c263f25f3724376e72396e28220a0b57e4.tar cuberite-b6e4d2c263f25f3724376e72396e28220a0b57e4.tar.gz cuberite-b6e4d2c263f25f3724376e72396e28220a0b57e4.tar.bz2 cuberite-b6e4d2c263f25f3724376e72396e28220a0b57e4.tar.lz cuberite-b6e4d2c263f25f3724376e72396e28220a0b57e4.tar.xz cuberite-b6e4d2c263f25f3724376e72396e28220a0b57e4.tar.zst cuberite-b6e4d2c263f25f3724376e72396e28220a0b57e4.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/FastRandom.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FastRandom.cpp b/src/FastRandom.cpp index 887e4426d..e6634bb0d 100644 --- a/src/FastRandom.cpp +++ b/src/FastRandom.cpp @@ -108,7 +108,7 @@ int cFastRandom::NextInt(int a_Range) int Counter = m_Counter++; // Use a_Range, m_Counter and m_Seed as inputs to the pseudorandom function: - int n = a_Range + m_Counter * 57 + m_Seed * 57 * 57; + int n = a_Range + Counter * 57 + m_Seed * 57 * 57; n = (n << 13) ^ n; n = ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff); return ((n / 11) % a_Range); @@ -127,7 +127,7 @@ int cFastRandom::NextInt(int a_Range, int a_Salt) int Counter = m_Counter++; // Use a_Range, a_Salt, m_Counter and m_Seed as inputs to the pseudorandom function: - int n = a_Range + m_Counter * 57 + m_Seed * 57 * 57 + a_Salt * 57 * 57 * 57; + int n = a_Range + Counter * 57 + m_Seed * 57 * 57 + a_Salt * 57 * 57 * 57; n = (n << 13) ^ n; n = ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff); return ((n / 11) % a_Range); @@ -143,7 +143,7 @@ float cFastRandom::NextFloat(float a_Range) int Counter = m_Counter++; // Use a_Range, a_Salt, m_Counter and m_Seed as inputs to the pseudorandom function: - int n = (int)a_Range + m_Counter * 57 + m_Seed * 57 * 57; + int n = (int)a_Range + Counter * 57 + m_Seed * 57 * 57; n = (n << 13) ^ n; n = ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff); @@ -161,7 +161,7 @@ float cFastRandom::NextFloat(float a_Range, int a_Salt) int Counter = m_Counter++; // Use a_Range, a_Salt, m_Counter and m_Seed as inputs to the pseudorandom function: - int n = (int)a_Range + m_Counter * 57 + m_Seed * 57 * 57 + a_Salt * 57 * 57 * 57; + int n = (int)a_Range + Counter * 57 + m_Seed * 57 * 57 + a_Salt * 57 * 57 * 57; n = (n << 13) ^ n; n = ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff); |