summaryrefslogtreecommitdiffstats
path: root/source/packets/cPacket_MapChunk.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-01 19:56:56 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-01 19:56:56 +0100
commita2f6ab93b6140740ca2562d5f82022a64c79feb6 (patch)
tree67b6272f417ea12dfa1b9bcf74d1fad15dc74802 /source/packets/cPacket_MapChunk.cpp
parentClients can join the server, but chunks are sent completely empty (diff)
downloadcuberite-a2f6ab93b6140740ca2562d5f82022a64c79feb6.tar
cuberite-a2f6ab93b6140740ca2562d5f82022a64c79feb6.tar.gz
cuberite-a2f6ab93b6140740ca2562d5f82022a64c79feb6.tar.bz2
cuberite-a2f6ab93b6140740ca2562d5f82022a64c79feb6.tar.lz
cuberite-a2f6ab93b6140740ca2562d5f82022a64c79feb6.tar.xz
cuberite-a2f6ab93b6140740ca2562d5f82022a64c79feb6.tar.zst
cuberite-a2f6ab93b6140740ca2562d5f82022a64c79feb6.zip
Diffstat (limited to 'source/packets/cPacket_MapChunk.cpp')
-rw-r--r--source/packets/cPacket_MapChunk.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/source/packets/cPacket_MapChunk.cpp b/source/packets/cPacket_MapChunk.cpp
index 859db47f3..99afd9a40 100644
--- a/source/packets/cPacket_MapChunk.cpp
+++ b/source/packets/cPacket_MapChunk.cpp
@@ -36,15 +36,23 @@ cPacket_MapChunk::cPacket_MapChunk(cChunk * a_Chunk)
m_UnusedInt = 0;
- for( int i = 0; i < 16; ++i )
- {
- m_BitMap1 |= (1 << i);
- }
-
unsigned int DataSize = 16 * (4096 + 2048 + 2048 + 2048);
char* AllData = new char[ DataSize ];
memset( AllData, 0, DataSize );
+ unsigned int iterator = 0;
+ for( int i = 0; i < 8; ++i ) // Old world is only 8 high
+ {
+ m_BitMap1 |= (1 << i);
+ for( int y = 0; y < 16; ++y ) for( int z = 0; z < 16; ++z ) for( int x = 0; x < 16; ++x )
+ {
+ AllData[iterator] = a_Chunk->GetBlock( x, y+i*16, z );
+ ++iterator;
+ }
+
+ //iterator+=2048*2; // Ignore light and stuff
+ }
+
uLongf CompressedSize = compressBound( DataSize );
char * CompressedBlockData = new char[CompressedSize];