From 1112f5adc6f66195ae030673e7831e46ae06c7b0 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 24 Jan 2014 23:56:19 +0000 Subject: Fixed a generator bug --- src/Generating/ChunkGenerator.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Generating/ChunkGenerator.cpp') 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); -- cgit v1.2.3 From 314fc3cdac702a44a257ada5fab52f0a7d37ffcd Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 25 Jan 2014 14:42:26 +0000 Subject: Mob bugfixes * Mobs no longer require constant line-of-sight to a player to remain aggravated * Fixed an ASSERT * Fixed mobs jumping * Fixed Idle state not properly using AI + Added FILE_IO_PREFIX to favicon loading + Implemented #563 --- src/Generating/ChunkGenerator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/Generating/ChunkGenerator.cpp') diff --git a/src/Generating/ChunkGenerator.cpp b/src/Generating/ChunkGenerator.cpp index 27210f49d..ef38f1399 100644 --- a/src/Generating/ChunkGenerator.cpp +++ b/src/Generating/ChunkGenerator.cpp @@ -223,6 +223,8 @@ void cChunkGenerator::Execute(void) if (m_Queue.empty()) { + // Sometimes the queue remains empty + // If so, we can't do any front() operations on it! continue; } -- cgit v1.2.3