summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-13 11:04:24 +0200
committerMattes D <github@xoft.cz>2014-07-13 11:04:24 +0200
commit48b5c11022a1140ff36d853eba391320da6e3983 (patch)
tree9d13c3e0537c5eca0a030889ec2f167359375d73 /src/WorldStorage/WSSAnvil.cpp
parentMerge pull request #1166 from Howaner/GlobalFixes (diff)
parentChanged comments. (diff)
downloadcuberite-48b5c11022a1140ff36d853eba391320da6e3983.tar
cuberite-48b5c11022a1140ff36d853eba391320da6e3983.tar.gz
cuberite-48b5c11022a1140ff36d853eba391320da6e3983.tar.bz2
cuberite-48b5c11022a1140ff36d853eba391320da6e3983.tar.lz
cuberite-48b5c11022a1140ff36d853eba391320da6e3983.tar.xz
cuberite-48b5c11022a1140ff36d853eba391320da6e3983.tar.zst
cuberite-48b5c11022a1140ff36d853eba391320da6e3983.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 fb2aebbf5..0b2a4c053 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -2086,10 +2086,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))
@@ -2102,6 +2103,12 @@ void cWSSAnvil::LoadSheepFromNBT(cEntityList & a_Entities, const cParsedNBT & a_
return;
}
+ int ShearedIdx = a_NBT.FindChildByName(a_TagIdx, "Sheared");
+ if (ShearedIdx > 0)
+ {
+ Monster->SetSheared(a_NBT.GetByte(ShearedIdx) != 0);
+ }
+
a_Entities.push_back(Monster.release());
}