From e94886c14068eb3b9f70e4ec4ae02b7f832b8fdc Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 14 Mar 2015 00:59:53 +0000 Subject: Fixed grass spread, closes #1743 - Removed the salt parameter in cFastRandom functions, it wasn't doing what we thought it was following the move to C++11 --- src/MobSpawner.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/MobSpawner.cpp') 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::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) ); } -- cgit v1.2.3