summaryrefslogtreecommitdiffstats
path: root/source/cChunk.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-04-10 13:22:11 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-04-10 13:22:11 +0200
commitc51a4b9469fee0314d1b849206d1cf1c7c1240e4 (patch)
tree655d6a392b5483eea1453a08c24e269f8ae68d09 /source/cChunk.cpp
parentCompression error -5 fix (diff)
downloadcuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.gz
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.bz2
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.lz
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.xz
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.tar.zst
cuberite-c51a4b9469fee0314d1b849206d1cf1c7c1240e4.zip
Diffstat (limited to '')
-rw-r--r--source/cChunk.cpp44
1 files changed, 15 insertions, 29 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index 54fbf4b94..597568a76 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -67,11 +67,11 @@ sSetBlock::sSetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_BlockM
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cChunk:
-cChunk::cChunk(int a_X, int a_Y, int a_Z, cChunkMap * a_ChunkMap, cWorld * a_World)
+cChunk::cChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cChunkMap * a_ChunkMap, cWorld * a_World)
: m_bCalculateLighting( false )
- , m_PosX( a_X )
- , m_PosY( a_Y )
- , m_PosZ( a_Z )
+ , m_PosX( a_ChunkX )
+ , m_PosY( a_ChunkY )
+ , m_PosZ( a_ChunkZ )
, m_BlockTickNum( 0 )
, m_BlockTickX( 0 )
, m_BlockTickY( 0 )
@@ -121,38 +121,24 @@ cChunk::~cChunk()
-void cChunk::SetValid(bool a_SendToClients)
+void cChunk::SetValid(void)
{
m_IsValid = true;
m_World->GetChunkMap()->ChunkValidated();
-
- if (!a_SendToClients)
- {
- return;
- }
-
- if (m_LoadedByClient.empty())
- {
- return;
- }
-
- // Sending the chunk here interferes with the lighting done in the tick thread and results in the "invalid compressed data" on the client
- /*
- cPacket_PreChunk PreChunk;
- PreChunk.m_PosX = m_PosX;
- PreChunk.m_PosZ = m_PosZ;
- PreChunk.m_bLoad = true;
- cPacket_MapChunk MapChunk(this);
- Broadcast(&PreChunk);
- Broadcast(&MapChunk);
-
- // Let all clients of this chunk know that it has been already sent to the client
+}
+
+
+
+
+
+void cChunk::MarkRegenerating(void)
+{
+ // Tell all clients attached to this chunk that they want this chunk:
for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr)
{
- (*itr)->ChunkJustSent(this);
+ (*itr)->AddWantedChunk(m_PosX, m_PosZ);
} // for itr - m_LoadedByClient[]
- */
}