summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-27 15:23:16 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-27 15:23:16 +0100
commitdee0a120298c4b7686f92071f8139a7bf6b4d126 (patch)
treed048959cb30519501a19cb28ddfa3b678b4745df
parentImplemented chunk loading without generating on load-failure (diff)
downloadcuberite-dee0a120298c4b7686f92071f8139a7bf6b4d126.tar
cuberite-dee0a120298c4b7686f92071f8139a7bf6b4d126.tar.gz
cuberite-dee0a120298c4b7686f92071f8139a7bf6b4d126.tar.bz2
cuberite-dee0a120298c4b7686f92071f8139a7bf6b4d126.tar.lz
cuberite-dee0a120298c4b7686f92071f8139a7bf6b4d126.tar.xz
cuberite-dee0a120298c4b7686f92071f8139a7bf6b4d126.tar.zst
cuberite-dee0a120298c4b7686f92071f8139a7bf6b4d126.zip
Diffstat (limited to '')
-rw-r--r--source/cChunkMap.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp
index 52e124107..eb9d71c60 100644
--- a/source/cChunkMap.cpp
+++ b/source/cChunkMap.cpp
@@ -329,7 +329,13 @@ bool cChunkMap::GetChunkBlocks(int a_ChunkX, int a_ChunkY, int a_ChunkZ, char *
bool cChunkMap::IsChunkValid(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
{
cCSLock Lock(m_CSLayers);
- cChunkPtr Chunk = GetChunkNoGen(a_ChunkX, a_ChunkY, a_ChunkZ);
+ cChunkLayer * Layer = GetLayerForChunk( a_ChunkX, a_ChunkZ );
+ if (Layer == NULL)
+ {
+ // An error must have occurred, since layers are automatically created if they don't exist
+ return false;
+ }
+ cChunkPtr Chunk = Layer->GetChunk(a_ChunkX, a_ChunkY, a_ChunkZ);
return (Chunk != NULL) && Chunk->IsValid();
}