diff options
author | p-mcgowan <mickeymcgowan@shaw.ca> | 2014-12-05 01:44:18 +0100 |
---|---|---|
committer | p-mcgowan <mickeymcgowan@shaw.ca> | 2014-12-05 01:44:18 +0100 |
commit | 53a33595b7c53d3728cc38627a3d0601fce735aa (patch) | |
tree | 52b9d7793f14ae4611f7076061aa875fdc70e702 /src/Generating | |
parent | format blocks and randomizing (diff) | |
download | cuberite-53a33595b7c53d3728cc38627a3d0601fce735aa.tar cuberite-53a33595b7c53d3728cc38627a3d0601fce735aa.tar.gz cuberite-53a33595b7c53d3728cc38627a3d0601fce735aa.tar.bz2 cuberite-53a33595b7c53d3728cc38627a3d0601fce735aa.tar.lz cuberite-53a33595b7c53d3728cc38627a3d0601fce735aa.tar.xz cuberite-53a33595b7c53d3728cc38627a3d0601fce735aa.tar.zst cuberite-53a33595b7c53d3728cc38627a3d0601fce735aa.zip |
Diffstat (limited to 'src/Generating')
-rw-r--r-- | src/Generating/FinishGen.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index e72e91c85..e50942073 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -1049,12 +1049,14 @@ bool cFinishGenPassiveMobs::TrySpawnAnimals(cChunkDesc & a_ChunkDesc, int a_RelX { return false; } - if ((BlockUnderFeet != E_BLOCK_GRASS) && - ((AnimalToSpawn == mtSheep) || (AnimalToSpawn == mtChicken) || (AnimalToSpawn == mtPig))) + if ( + (BlockUnderFeet != E_BLOCK_GRASS) && + ((AnimalToSpawn == mtSheep) || (AnimalToSpawn == mtChicken) || (AnimalToSpawn == mtPig)) + ) { return false; } - if (AnimalToSpawn == mtMooshroom && BlockUnderFeet != E_BLOCK_MYCELIUM) + if ((AnimalToSpawn == mtMooshroom) && (BlockUnderFeet != E_BLOCK_MYCELIUM)) { return false; } @@ -1150,13 +1152,18 @@ eMonsterType cFinishGenPassiveMobs::GetRandomMob(cChunkDesc & a_ChunkDesc) } } + ListOfSpawnables.insert(MobIter, mtChicken); + ListOfSpawnables.insert(MobIter, mtCow); + ListOfSpawnables.insert(MobIter, mtPig); + ListOfSpawnables.insert(MobIter, mtSheep); + if (ListOfSpawnables.empty()) { return mtInvalidType; } int RandMob = (m_Noise.IntNoise2DInt(chunkX - chunkZ + 2, chunkX + 5) / 7) % ListOfSpawnables.size(); - MobIter=ListOfSpawnables.begin(); + MobIter = ListOfSpawnables.begin(); for (int i = 0; i < RandMob; i++) { ++MobIter; |