diff options
author | p-mcgowan <mickeymcgowan@shaw.ca> | 2014-12-02 20:32:53 +0100 |
---|---|---|
committer | p-mcgowan <mickeymcgowan@shaw.ca> | 2014-12-02 20:32:53 +0100 |
commit | 6803df129f6e197e4f45294d46002f6dd8469655 (patch) | |
tree | fd0aa269150ef7e66e2f4651aef6e9e1c44cc6a1 /src/Generating/FinishGen.cpp | |
parent | fastRandom unused (diff) | |
download | cuberite-6803df129f6e197e4f45294d46002f6dd8469655.tar cuberite-6803df129f6e197e4f45294d46002f6dd8469655.tar.gz cuberite-6803df129f6e197e4f45294d46002f6dd8469655.tar.bz2 cuberite-6803df129f6e197e4f45294d46002f6dd8469655.tar.lz cuberite-6803df129f6e197e4f45294d46002f6dd8469655.tar.xz cuberite-6803df129f6e197e4f45294d46002f6dd8469655.tar.zst cuberite-6803df129f6e197e4f45294d46002f6dd8469655.zip |
Diffstat (limited to 'src/Generating/FinishGen.cpp')
-rw-r--r-- | src/Generating/FinishGen.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index 3e5b24017..0844b01ab 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -986,6 +986,8 @@ cFinishGenPassiveMobs::cFinishGenPassiveMobs(int a_Seed, cIniFile & a_IniFile, e void cFinishGenPassiveMobs::GenFinish(cChunkDesc & a_ChunkDesc) { + int chunkX = a_ChunkDesc.GetChunkX(); + int chunkZ = a_ChunkDesc.GetChunkZ(); int ChanceRnd = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % 100; if (ChanceRnd > m_AnimalProbability) { @@ -1074,6 +1076,8 @@ eMonsterType cFinishGenPassiveMobs::GetRandomMob(cChunkDesc & a_ChunkDesc) std::set<eMonsterType> ListOfSpawnables; std::set<eMonsterType>::iterator MobIter = ListOfSpawnables.begin(); + int chunkX = a_ChunkDesc.GetChunkX(); + int chunkZ = a_ChunkDesc.GetChunkZ(); int x = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width; int z = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % cChunkDef::Width; @@ -1137,7 +1141,7 @@ eMonsterType cFinishGenPassiveMobs::GetRandomMob(cChunkDesc & a_ChunkDesc) return mtInvalidType; } - int RandMob = m_Random.NextInt(ListOfSpawnables.size()); + int RandMob = (m_Noise.IntNoise2DInt(chunkX, chunkZ) / 7) % ListOfSpawnables.size(); MobIter=ListOfSpawnables.begin(); for (int i = 0; i < RandMob; i++) { |