summaryrefslogtreecommitdiffstats
path: root/src/ChunkSender.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-20 22:55:07 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-10-20 22:55:07 +0200
commit987f79afdd8945966d0dfa2d52539e005f771590 (patch)
treefa55849604121317e0a565465212032ebe4b79cb /src/ChunkSender.cpp
parentUse std::recusive_mutex (diff)
downloadcuberite-987f79afdd8945966d0dfa2d52539e005f771590.tar
cuberite-987f79afdd8945966d0dfa2d52539e005f771590.tar.gz
cuberite-987f79afdd8945966d0dfa2d52539e005f771590.tar.bz2
cuberite-987f79afdd8945966d0dfa2d52539e005f771590.tar.lz
cuberite-987f79afdd8945966d0dfa2d52539e005f771590.tar.xz
cuberite-987f79afdd8945966d0dfa2d52539e005f771590.tar.zst
cuberite-987f79afdd8945966d0dfa2d52539e005f771590.zip
Diffstat (limited to 'src/ChunkSender.cpp')
-rw-r--r--src/ChunkSender.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp
index a3151eb3f..c94004780 100644
--- a/src/ChunkSender.cpp
+++ b/src/ChunkSender.cpp
@@ -35,9 +35,9 @@ void cNotifyChunkSender::Call(int a_ChunkX, int a_ChunkZ)
cChunkSender::cChunkSender(void) :
super("ChunkSender"),
- m_World(NULL),
+ m_World(nullptr),
m_RemoveCount(0),
- m_Notify(NULL)
+ m_Notify(nullptr)
{
m_Notify.SetChunkSender(this);
}
@@ -93,7 +93,7 @@ void cChunkSender::ChunkReady(int a_ChunkX, int a_ChunkZ)
void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client)
{
- ASSERT(a_Client != NULL);
+ ASSERT(a_Client != nullptr);
{
cCSLock Lock(m_CS);
if (std::find(m_SendChunks.begin(), m_SendChunks.end(), sSendChunk(a_ChunkX, a_ChunkZ, a_Client)) != m_SendChunks.end())
@@ -161,7 +161,7 @@ void cChunkSender::Execute(void)
m_ChunksReady.pop_front();
Lock.Unlock();
- SendChunk(Coords.m_ChunkX, Coords.m_ChunkZ, NULL);
+ SendChunk(Coords.m_ChunkX, Coords.m_ChunkZ, nullptr);
}
else
{
@@ -189,10 +189,10 @@ void cChunkSender::Execute(void)
void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client)
{
- ASSERT(m_World != NULL);
+ ASSERT(m_World != nullptr);
// Ask the client if it still wants the chunk:
- if (a_Client != NULL)
+ if (a_Client != nullptr)
{
if (!a_Client->WantsSendChunk(a_ChunkX, a_ChunkZ))
{
@@ -227,7 +227,7 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Clien
cChunkDataSerializer Data(m_BlockTypes, m_BlockMetas, m_BlockLight, m_BlockSkyLight, m_BiomeMap);
// Send:
- if (a_Client == NULL)
+ if (a_Client == nullptr)
{
m_World->BroadcastChunkData(a_ChunkX, a_ChunkZ, Data);
}
@@ -239,7 +239,7 @@ void cChunkSender::SendChunk(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Clien
// Send block-entity packets:
for (sBlockCoords::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end(); ++itr)
{
- if (a_Client == NULL)
+ if (a_Client == nullptr)
{
m_World->BroadcastBlockEntity(itr->m_BlockX, itr->m_BlockY, itr->m_BlockZ);
}