diff options
author | worktycho <work.tycho@gmail.com> | 2015-05-30 11:32:35 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-05-30 11:32:35 +0200 |
commit | 2ce405883ac34f3f2e443d60ba93a94568568f39 (patch) | |
tree | 63de5aa4fdcfe13224e954aa557096a720389401 /src/Generating/FinishGen.cpp | |
parent | Merge pull request #2167 from SafwatHalaby/diags (diff) | |
parent | Fix FreeBSD/clang errors caused by -Werror (diff) | |
download | cuberite-2ce405883ac34f3f2e443d60ba93a94568568f39.tar cuberite-2ce405883ac34f3f2e443d60ba93a94568568f39.tar.gz cuberite-2ce405883ac34f3f2e443d60ba93a94568568f39.tar.bz2 cuberite-2ce405883ac34f3f2e443d60ba93a94568568f39.tar.lz cuberite-2ce405883ac34f3f2e443d60ba93a94568568f39.tar.xz cuberite-2ce405883ac34f3f2e443d60ba93a94568568f39.tar.zst cuberite-2ce405883ac34f3f2e443d60ba93a94568568f39.zip |
Diffstat (limited to '')
-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 5540f80d4..656dc95db 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -1375,8 +1375,12 @@ eMonsterType cFinishGenPassiveMobs::GetRandomMob(cChunkDesc & a_ChunkDesc) return mtInvalidType; } - size_t RandMob = static_cast<size_t>((m_Noise.IntNoise2DInt(chunkX - chunkZ + 2, chunkX + 5) / 7)) % ListOfSpawnables.size(); auto MobIter = ListOfSpawnables.begin(); + using diff_type = + std::iterator_traits<decltype(MobIter)>::difference_type; + diff_type RandMob = static_cast<diff_type> + ((unsigned long)(m_Noise.IntNoise2DInt(chunkX - chunkZ + 2, chunkX + 5) / 7) + % ListOfSpawnables.size()); std::advance(MobIter, RandMob); return *MobIter; |