diff options
Diffstat (limited to '')
-rw-r--r-- | src/ChunkMap.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 7bdd1c649..669a4f564 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -1339,10 +1339,18 @@ void cChunkMap::SpawnMobs(cMobSpawner & a_MobSpawner) void cChunkMap::Tick(std::chrono::milliseconds a_Dt) { cCSLock Lock(m_CSChunks); + + // Do the magic of updating the world: for (auto & Chunk : m_Chunks) { Chunk.second.Tick(a_Dt); } + + // Finally, only after all chunks are ticked, tell the client about all aggregated changes: + for (auto & Chunk : m_Chunks) + { + Chunk.second.BroadcastPendingChanges(); + } } |