summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/ChunkSender.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/ChunkSender.cpp b/source/ChunkSender.cpp
index 5d7efbdc8..3374a0bff 100644
--- a/source/ChunkSender.cpp
+++ b/source/ChunkSender.cpp
@@ -78,8 +78,11 @@ void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cC
ASSERT(a_Client != NULL);
{
cCSLock Lock(m_CS);
- // It should not be already queued:
- ASSERT(std::find(m_SendChunks.begin(), m_SendChunks.end(), sSendChunk(a_ChunkX, a_ChunkY, a_ChunkZ, a_Client)) == m_SendChunks.end());
+ if (std::find(m_SendChunks.begin(), m_SendChunks.end(), sSendChunk(a_ChunkX, a_ChunkY, a_ChunkZ, a_Client)) != m_SendChunks.end())
+ {
+ // Already queued, bail out
+ return;
+ }
m_SendChunks.push_back(sSendChunk(a_ChunkX, a_ChunkY, a_ChunkZ, a_Client));
}
m_evtQueue.Set();