summaryrefslogtreecommitdiffstats
path: root/src/MobSpawner.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-03-15 13:16:37 +0100
committerworktycho <work.tycho@gmail.com>2015-03-15 13:16:37 +0100
commit83531707f3219490eb8ad1e2a7308ff7d4c5fde1 (patch)
treeb379005ad92e48bb696b40fa1b05a35034498710 /src/MobSpawner.cpp
parentMerge pull request #1734 from mc-server/pistons (diff)
parentUse thread_local in cFastRandom (diff)
downloadcuberite-83531707f3219490eb8ad1e2a7308ff7d4c5fde1.tar
cuberite-83531707f3219490eb8ad1e2a7308ff7d4c5fde1.tar.gz
cuberite-83531707f3219490eb8ad1e2a7308ff7d4c5fde1.tar.bz2
cuberite-83531707f3219490eb8ad1e2a7308ff7d4c5fde1.tar.lz
cuberite-83531707f3219490eb8ad1e2a7308ff7d4c5fde1.tar.xz
cuberite-83531707f3219490eb8ad1e2a7308ff7d4c5fde1.tar.zst
cuberite-83531707f3219490eb8ad1e2a7308ff7d4c5fde1.zip
Diffstat (limited to 'src/MobSpawner.cpp')
-rw-r--r--src/MobSpawner.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/MobSpawner.cpp b/src/MobSpawner.cpp
index 541135996..7a5238fd8 100644
--- a/src/MobSpawner.cpp
+++ b/src/MobSpawner.cpp
@@ -110,8 +110,7 @@ eMonsterType cMobSpawner::ChooseMobType(EMCSBiome a_Biome)
if (allowedMobsSize > 0)
{
std::set<eMonsterType>::iterator itr = allowedMobs.begin();
- static int Counter = 0;
- int iRandom = m_Random.NextInt((int)allowedMobsSize, Counter++);
+ int iRandom = m_Random.NextInt((int)allowedMobsSize);
for (int i = 0; i < iRandom; i++)
{
@@ -187,7 +186,7 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
(BlockBelow == E_BLOCK_GRASS) || (BlockBelow == E_BLOCK_LEAVES) || (BlockBelow == E_BLOCK_NEW_LEAVES)
) &&
(a_RelY >= 62) &&
- (Random.NextInt(3, a_Biome) != 0)
+ (Random.NextInt(3) != 0)
);
}
@@ -248,7 +247,7 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
(!cBlockInfo::IsTransparent(BlockBelow)) &&
(SkyLight <= 7) &&
(BlockLight <= 7) &&
- (Random.NextInt(2, a_Biome) == 0)
+ (Random.NextInt(2) == 0)
);
}
@@ -272,7 +271,7 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
(TargetBlock == E_BLOCK_AIR) &&
(BlockAbove == E_BLOCK_AIR) &&
(!cBlockInfo::IsTransparent(BlockBelow)) &&
- (Random.NextInt(20, a_Biome) == 0)
+ (Random.NextInt(20) == 0)
);
}