1
0

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
This commit is contained in:
madmaxoft@gmail.com 2012-02-28 10:01:42 +00:00
parent 2c9198b208
commit 67ffb8a1da

View File

@ -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;
}