summaryrefslogtreecommitdiffstats
path: root/source/cChunkMap.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-26 17:46:23 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-26 17:46:23 +0100
commit1f88db187bbc1bacc29a2f263c73ff383aa06e91 (patch)
treed8332cf8d866223b47b579a65fb3e2a2d41e92fc /source/cChunkMap.cpp
parentNew cChunkStay class for temporarily keeping chunks loaded even when then have no clients. For now unused, will be used by generator and lighting in the future. (diff)
downloadcuberite-1f88db187bbc1bacc29a2f263c73ff383aa06e91.tar
cuberite-1f88db187bbc1bacc29a2f263c73ff383aa06e91.tar.gz
cuberite-1f88db187bbc1bacc29a2f263c73ff383aa06e91.tar.bz2
cuberite-1f88db187bbc1bacc29a2f263c73ff383aa06e91.tar.lz
cuberite-1f88db187bbc1bacc29a2f263c73ff383aa06e91.tar.xz
cuberite-1f88db187bbc1bacc29a2f263c73ff383aa06e91.tar.zst
cuberite-1f88db187bbc1bacc29a2f263c73ff383aa06e91.zip
Diffstat (limited to '')
-rw-r--r--source/cChunkMap.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp
index 548040724..52e124107 100644
--- a/source/cChunkMap.cpp
+++ b/source/cChunkMap.cpp
@@ -115,9 +115,13 @@ cChunkPtr cChunkMap::GetChunk( int a_ChunkX, int a_ChunkY, int a_ChunkZ )
}
cChunkPtr Chunk = Layer->GetChunk(a_ChunkX, a_ChunkY, a_ChunkZ);
+ if (Chunk == NULL)
+ {
+ return NULL;
+ }
if (!(Chunk->IsValid()))
{
- m_World->GetStorage().QueueLoadChunk(a_ChunkX, a_ChunkY, a_ChunkZ);
+ m_World->GetStorage().QueueLoadChunk(a_ChunkX, a_ChunkY, a_ChunkZ, true);
}
return Chunk;
}
@@ -137,8 +141,14 @@ cChunkPtr cChunkMap::GetChunkNoGen( int a_ChunkX, int a_ChunkY, int a_ChunkZ )
}
cChunkPtr Chunk = Layer->GetChunk(a_ChunkX, a_ChunkY, a_ChunkZ);
-
- // TODO: Load, but do not generate, if not valid
+ if (Chunk == NULL)
+ {
+ return NULL;
+ }
+ if (!(Chunk->IsValid()))
+ {
+ m_World->GetStorage().QueueLoadChunk(a_ChunkX, a_ChunkY, a_ChunkZ, false);
+ }
return Chunk;
}