diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-27 15:23:16 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-27 15:23:16 +0100 |
commit | dee0a120298c4b7686f92071f8139a7bf6b4d126 (patch) | |
tree | d048959cb30519501a19cb28ddfa3b678b4745df /source | |
parent | Implemented chunk loading without generating on load-failure (diff) | |
download | cuberite-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 'source')
-rw-r--r-- | source/cChunkMap.cpp | 8 |
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();
}
|