1
0

Fixed loading empty chunks.

Reported on the Dropper map in #1307.
This commit is contained in:
Mattes D 2014-09-05 22:55:39 +02:00
parent 137b021d26
commit 4230eb3d92
2 changed files with 7 additions and 2 deletions

View File

@ -44,7 +44,6 @@ cSetChunkData::cSetChunkData(
// Check the params' validity: // Check the params' validity:
ASSERT(a_BlockTypes != NULL); ASSERT(a_BlockTypes != NULL);
ASSERT(a_BlockMetas != NULL); ASSERT(a_BlockMetas != NULL);
ASSERT(a_Biomes != NULL);
// Copy block types and metas: // Copy block types and metas:
memcpy(m_BlockTypes, a_BlockTypes, sizeof(cChunkDef::BlockTypes)); memcpy(m_BlockTypes, a_BlockTypes, sizeof(cChunkDef::BlockTypes));

View File

@ -323,7 +323,13 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT
return false; return false;
} }
int Sections = a_NBT.FindChildByName(Level, "Sections"); int Sections = a_NBT.FindChildByName(Level, "Sections");
if ((Sections < 0) || (a_NBT.GetType(Sections) != TAG_List) || (a_NBT.GetChildrenType(Sections) != TAG_Compound)) if ((Sections < 0) || (a_NBT.GetType(Sections) != TAG_List))
{
LOAD_FAILED(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ);
return false;
}
eTagType SectionsType = a_NBT.GetChildrenType(Sections);
if ((SectionsType != TAG_Compound) && (SectionsType != TAG_End))
{ {
LOAD_FAILED(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ); LOAD_FAILED(a_Chunk.m_ChunkX, a_Chunk.m_ChunkZ);
return false; return false;