diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-25 00:56:19 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-25 00:56:19 +0100 |
commit | 1112f5adc6f66195ae030673e7831e46ae06c7b0 (patch) | |
tree | 905608852fda73d40f20bca4a975f593eb4d77a1 /src/Generating | |
parent | Zombies and skeletons use AI (diff) | |
download | cuberite-1112f5adc6f66195ae030673e7831e46ae06c7b0.tar cuberite-1112f5adc6f66195ae030673e7831e46ae06c7b0.tar.gz cuberite-1112f5adc6f66195ae030673e7831e46ae06c7b0.tar.bz2 cuberite-1112f5adc6f66195ae030673e7831e46ae06c7b0.tar.lz cuberite-1112f5adc6f66195ae030673e7831e46ae06c7b0.tar.xz cuberite-1112f5adc6f66195ae030673e7831e46ae06c7b0.tar.zst cuberite-1112f5adc6f66195ae030673e7831e46ae06c7b0.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/ChunkGenerator.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Generating/ChunkGenerator.cpp b/src/Generating/ChunkGenerator.cpp index baa5b76b8..27210f49d 100644 --- a/src/Generating/ChunkGenerator.cpp +++ b/src/Generating/ChunkGenerator.cpp @@ -201,7 +201,7 @@ void cChunkGenerator::Execute(void) while (!m_ShouldTerminate) { cCSLock Lock(m_CS); - while (m_Queue.size() == 0) + while (m_Queue.empty()) { if ((NumChunksGenerated > 16) && (clock() - LastReportTick > CLOCKS_PER_SEC)) { @@ -221,6 +221,11 @@ void cChunkGenerator::Execute(void) LastReportTick = clock(); } + if (m_Queue.empty()) + { + continue; + } + cChunkCoords coords = m_Queue.front(); // Get next coord from queue m_Queue.erase( m_Queue.begin() ); // Remove coordinate from queue bool SkipEnabled = (m_Queue.size() > QUEUE_SKIP_LIMIT); |