summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-28 11:01:42 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-28 11:01:42 +0100
commit67ffb8a1da9b0db167666ebf9d89f6b1818cd79c (patch)
tree07147efb490fedb2f2e2ce64fb73e2f5070fe491
parentConst-correctness for packet broadcasting (fixes GCC compilation) (diff)
downloadcuberite-67ffb8a1da9b0db167666ebf9d89f6b1818cd79c.tar
cuberite-67ffb8a1da9b0db167666ebf9d89f6b1818cd79c.tar.gz
cuberite-67ffb8a1da9b0db167666ebf9d89f6b1818cd79c.tar.bz2
cuberite-67ffb8a1da9b0db167666ebf9d89f6b1818cd79c.tar.lz
cuberite-67ffb8a1da9b0db167666ebf9d89f6b1818cd79c.tar.xz
cuberite-67ffb8a1da9b0db167666ebf9d89f6b1818cd79c.tar.zst
cuberite-67ffb8a1da9b0db167666ebf9d89f6b1818cd79c.zip
-rw-r--r--source/cChunkGenerator.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/cChunkGenerator.cpp b/source/cChunkGenerator.cpp
index c66d20082..072326eb6 100644
--- a/source/cChunkGenerator.cpp
+++ b/source/cChunkGenerator.cpp
@@ -21,7 +21,7 @@ typedef std::list< ChunkCoord > ChunkCoordList;
const int QUEUE_WARNING_LIMIT = 1000;
/// If the generation queue size exceeds this number, chunks with no clients will be skipped
-const int QUEUE_SKIP_LIMIT = 50;
+const int QUEUE_SKIP_LIMIT = 500;
@@ -155,12 +155,15 @@ void cChunkGenerator::Execute(void)
Lock.Unlock(); // Unlock ASAP
m_evtRemoved.Set();
- if (
- m_World->IsChunkValid(coords.m_ChunkX, coords.m_ChunkY, coords.m_ChunkZ) ||
- (SkipEnabled && m_World->HasChunkAnyClients(coords.m_ChunkX, coords.m_ChunkY, coords.m_ChunkZ))
- )
+ if (m_World->IsChunkValid(coords.m_ChunkX, coords.m_ChunkY, coords.m_ChunkZ))
{
- // Already generated / overload-skip, ignore request
+ // Already generated, ignore request
+ continue;
+ }
+
+ if (SkipEnabled && !m_World->HasChunkAnyClients(coords.m_ChunkX, coords.m_ChunkY, coords.m_ChunkZ))
+ {
+ LOGWARNING("Chunk generator overloaded, skipping chunk [%d, %d, %d] (HasClients: %d)", coords.m_ChunkX, coords.m_ChunkY, coords.m_ChunkZ);
continue;
}