summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/Chunk.cpp5
-rw-r--r--source/ClientHandle.cpp2
2 files changed, 7 insertions, 0 deletions
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);
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index 07d580085..57830f63c 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -1502,6 +1502,8 @@ void cClientHandle::SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BL
void cClientHandle::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes)
{
+ ASSERT(!a_Changes.empty()); // We don't want to be sending empty change packets!
+
m_Protocol->SendBlockChanges(a_ChunkX, a_ChunkZ, a_Changes);
}