From 9cb88728511c314695731d92cb4ab16c8e3b051e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 23 Apr 2012 21:20:32 +0000 Subject: Anvil storage writing (Basic storage is working, NO entities except for chests are working! Don't use for real servers) git-svn-id: http://mc-server.googlecode.com/svn/trunk@475 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/NBT.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/NBT.cpp') diff --git a/source/NBT.cpp b/source/NBT.cpp index af420cd27..ba2f3d0f6 100644 --- a/source/NBT.cpp +++ b/source/NBT.cpp @@ -74,7 +74,7 @@ cNBTTag * cNBTTag::CreateTag(cNBTTag * a_Parent, eTagType a_Type, const AString case TAG_Double: return new cNBTDouble (a_Parent, a_Name); case TAG_ByteArray: return new cNBTByteArray(a_Parent, a_Name); case TAG_String: return new cNBTString (a_Parent, a_Name); - case TAG_List: return new cNBTList (a_Parent, a_Name); + case TAG_List: return new cNBTList (a_Parent, a_Name, TAG_End); case TAG_Compound: return new cNBTCompound (a_Parent, a_Name); default: { @@ -128,8 +128,8 @@ void cNBTList::Clear(void) int cNBTList::Add(cNBTTag * iTag) { // Catch usage errors while debugging: - ASSERT(m_ChildrenType != TAG_End); - ASSERT(iTag->GetType() == m_ChildrenType); + ASSERT(m_ChildrenType != TAG_End); // Didn't call SetChildrenType() + ASSERT(iTag->GetType() == m_ChildrenType); // Child of different type // Catch errors while running: if (m_ChildrenType == TAG_End) @@ -535,12 +535,11 @@ int cNBTParser::ReadTag(const char ** a_Data, int * a_Length, cNBTTag::eTagType { char ItemType; RETURN_INT_IF_FAILED(ReadByte (a_Data, a_Length, ItemType)); - cNBTList * List = new cNBTList(a_Parent, a_Name); + cNBTList * List = new cNBTList(a_Parent, a_Name, (cNBTTag::eTagType)ItemType); if (List == NULL) { return ERROR_NOT_ENOUGH_MEMORY; } - RETURN_INT_IF_FAILED(List->SetChildrenType((cNBTTag::eTagType)ItemType)); RETURN_INT_IF_FAILED(ReadList(a_Data, a_Length, List)); *a_Tag = List; return ERROR_SUCCESS; -- cgit v1.2.3