diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-28 11:01:42 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-28 11:01:42 +0100 |
commit | 67ffb8a1da9b0db167666ebf9d89f6b1818cd79c (patch) | |
tree | 07147efb490fedb2f2e2ce64fb73e2f5070fe491 /source/cChunkGenerator.cpp | |
parent | Const-correctness for packet broadcasting (fixes GCC compilation) (diff) | |
download | cuberite-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 |
Diffstat (limited to '')
-rw-r--r-- | source/cChunkGenerator.cpp | 15 |
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;
}
|