From 67ffb8a1da9b0db167666ebf9d89f6b1818cd79c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 28 Feb 2012 10:01:42 +0000 Subject: ChunkGenerator: fixed an inverted condition on chunk-skipping when the generator is overloaded; set the overload threshold to 500 chunks (from original 50 which is not enough even for a single player) git-svn-id: http://mc-server.googlecode.com/svn/trunk@334 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunkGenerator.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'source') 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; } -- cgit v1.2.3