diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-03-13 21:32:11 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-03-13 21:32:11 +0100 |
commit | 8be2528350b6fd5a4283e654bbe21d5d35e964d7 (patch) | |
tree | 8e986cf577b9b42e348649c55ca268c0c3d3ef2c /source | |
parent | Small optimizations in the SetNibble() and GetNibble() functions; removed unused lighting functions from cChunk (diff) | |
download | cuberite-8be2528350b6fd5a4283e654bbe21d5d35e964d7.tar cuberite-8be2528350b6fd5a4283e654bbe21d5d35e964d7.tar.gz cuberite-8be2528350b6fd5a4283e654bbe21d5d35e964d7.tar.bz2 cuberite-8be2528350b6fd5a4283e654bbe21d5d35e964d7.tar.lz cuberite-8be2528350b6fd5a4283e654bbe21d5d35e964d7.tar.xz cuberite-8be2528350b6fd5a4283e654bbe21d5d35e964d7.tar.zst cuberite-8be2528350b6fd5a4283e654bbe21d5d35e964d7.zip |
Diffstat (limited to 'source')
-rw-r--r-- | source/ChunkSender.cpp | 7 |
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();
|