From 94f8884f607deffb486f74a753dca2ea9c84cdbc Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 19 Aug 2013 21:55:03 +0200 Subject: Fixed the extreme strain on the world tick thread. Block changes were sent even with empty changesets, causing a lot of lost CPU cycles. --- source/Chunk.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/Chunk.cpp') diff --git a/source/Chunk.cpp b/source/Chunk.cpp index e17e4bebc..db533f642 100644 --- a/source/Chunk.cpp +++ b/source/Chunk.cpp @@ -573,6 +573,11 @@ void cChunk::ProcessQueuedSetBlocks(void) void cChunk::BroadcastPendingBlockChanges(void) { + if (m_PendingSendBlocks.empty()) + { + return; + } + for (cClientHandleList::iterator itr = m_LoadedByClient.begin(), end = m_LoadedByClient.end(); itr != end; ++itr) { (*itr)->SendBlockChanges(m_PosX, m_PosZ, m_PendingSendBlocks); -- cgit v1.2.3