From 11d02a447e45e96e4652f25afc6d040597ad2064 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 28 Jun 2014 13:19:32 +0200 Subject: Save IsSheared from Sheep. --- src/WorldStorage/WSSAnvil.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/WorldStorage/WSSAnvil.cpp') diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 9870c144a..5c209c7fa 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -2073,10 +2073,11 @@ void cWSSAnvil::LoadPigFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NB void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { int ColorIdx = a_NBT.FindChildByName(a_TagIdx, "Color"); - - if (ColorIdx < 0) { return; } - - int Color = (int)a_NBT.GetByte(ColorIdx); + int Color = -1; + if (ColorIdx > 0) + { + Color = (int)a_NBT.GetByte(ColorIdx); + } std::auto_ptr Monster(new cSheep(Color)); if (!LoadEntityBaseFromNBT(*Monster.get(), a_NBT, a_TagIdx)) @@ -2089,6 +2090,12 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ return; } + int ShearedIdx = a_NBT.FindChildByName(a_TagIdx, "Sheared"); + if (ShearedIdx > 0) + { + Monster.get()->SetSheared((bool)a_NBT.GetByte(ShearedIdx)); + } + a_Entities.push_back(Monster.release()); } -- cgit v1.2.3