From dee0a120298c4b7686f92071f8139a7bf6b4d126 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 27 Feb 2012 14:23:16 +0000 Subject: Fix for the perpetual load issue git-svn-id: http://mc-server.googlecode.com/svn/trunk@332 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunkMap.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source') 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(); } -- cgit v1.2.3