summaryrefslogtreecommitdiffstats
path: root/source/cChunkMap.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-31 01:52:20 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-10-31 01:52:20 +0100
commite2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f (patch)
tree2519b9736038f7d5374719122b4ba7937d2e309c /source/cChunkMap.cpp
parentput the timer and quicksort functions into their own files. Made a few changes to the converter. Converter doesn't understand Entity tags and some chunks cause it to segfault for a currently unknown reason. (diff)
downloadcuberite-e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f.tar
cuberite-e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f.tar.gz
cuberite-e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f.tar.bz2
cuberite-e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f.tar.lz
cuberite-e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f.tar.xz
cuberite-e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f.tar.zst
cuberite-e2f1cf51c759f0c70bc1dc9f1db3a8575e1db10f.zip
Diffstat (limited to 'source/cChunkMap.cpp')
-rw-r--r--source/cChunkMap.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp
index 32bdf576a..44dfe3a29 100644
--- a/source/cChunkMap.cpp
+++ b/source/cChunkMap.cpp
@@ -19,12 +19,13 @@
#define LAYER_SIZE (32)
-cChunkMap::cChunkMap( int a_Width, int a_Height )
+cChunkMap::cChunkMap( int a_Width, int a_Height, cWorld* a_World )
: m_Nodes( new cChunkNode[ a_Width * a_Height ] )
, m_Width( a_Width )
, m_Height( a_Height )
, m_Layers( 0 )
, m_NumLayers( 0 )
+ , m_World( a_World )
{
}
@@ -362,7 +363,7 @@ cChunk* cChunkMap::GetChunk( int a_X, int a_Y, int a_Z )
}
else
{
- cChunk* Chunk = new cChunk(a_X, a_Y, a_Z);
+ cChunk* Chunk = new cChunk(a_X, a_Y, a_Z, m_World);
memcpy( Chunk->m_BlockData, BlockData, cChunk::c_BlockDataSize );
Chunk->CalculateHeightmap();
Data->m_LiveChunk = Chunk;
@@ -426,7 +427,7 @@ void cChunkMap::Tick( float a_Dt )
void cChunkMap::UnloadUnusedChunks()
{
- cWorld* World = cRoot::Get()->GetWorld();
+ cWorld* World = m_World;
/* // OLD
for( int i = 0; i < m_Width*m_Height; ++i )
{