summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
author0ddlyoko <nathangiaco@hotmail.com>2020-11-06 17:54:01 +0100
committerGitHub <noreply@github.com>2020-11-06 17:54:01 +0100
commit672bb0457012612ef59502b33717ee789c4d6bfe (patch)
tree962a76ff85b12a868009fa01659122386e695d0e /src/Chunk.cpp
parentEnder Crytal Fix and report proper cmake file for luabindingscheck fail (#5017) (diff)
downloadcuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.gz
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.bz2
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.lz
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.xz
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.zst
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.zip
Diffstat (limited to '')
-rw-r--r--src/Chunk.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index df9292fae..663713cf3 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -820,10 +820,12 @@ void cChunk::TickBlocks(void)
// Tick random blocks, but the first one should be m_BlockToTick (so that SetNextBlockToTick() works)
auto Idx = cChunkDef::MakeIndexNoCheck(m_BlockToTick);
+ auto & Random = GetRandomProvider();
+
for (int i = 0; i < 50; ++i)
{
auto Pos = cChunkDef::IndexToCoordinate(static_cast<size_t>(Idx));
- Idx = m_World->GetTickRandomNumber(cChunkDef::NumBlocks - 1);
+ Idx = Random.RandInt(cChunkDef::NumBlocks - 1);
if (Pos.y > cChunkDef::GetHeight(m_HeightMap, Pos.x, Pos.z))
{
continue; // It's all air up here