summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorlinnemannr <linnemannr@gmail.com>2015-05-30 10:23:57 +0200
committerlinnemannr <linnemannr@gmail.com>2015-05-30 10:23:57 +0200
commitee34e7131a5a7a308fe431c44741d68a10bb2625 (patch)
tree8f72bc78944f08e0287bf9c782c8152a138a6489 /src/Generating
parentMerge pull request #2166 from SafwatHalaby/squid (diff)
downloadcuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar
cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.gz
cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.bz2
cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.lz
cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.xz
cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.tar.zst
cuberite-ee34e7131a5a7a308fe431c44741d68a10bb2625.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/FinishGen.cpp6
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;