summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-06-28 13:19:32 +0200
committerHowaner <franzi.moos@googlemail.com>2014-06-28 13:19:32 +0200
commit11d02a447e45e96e4652f25afc6d040597ad2064 (patch)
tree648742a8589b7536bd101b3a25c16e3c1375870b /src/WorldStorage/WSSAnvil.cpp
parentFix sheep color's, add shear sound. (diff)
downloadcuberite-11d02a447e45e96e4652f25afc6d040597ad2064.tar
cuberite-11d02a447e45e96e4652f25afc6d040597ad2064.tar.gz
cuberite-11d02a447e45e96e4652f25afc6d040597ad2064.tar.bz2
cuberite-11d02a447e45e96e4652f25afc6d040597ad2064.tar.lz
cuberite-11d02a447e45e96e4652f25afc6d040597ad2064.tar.xz
cuberite-11d02a447e45e96e4652f25afc6d040597ad2064.tar.zst
cuberite-11d02a447e45e96e4652f25afc6d040597ad2064.zip
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rw-r--r--src/WorldStorage/WSSAnvil.cpp15
1 files changed, 11 insertions, 4 deletions
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<cSheep> 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());
}