summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-13 11:09:19 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-13 11:09:19 +0200
commite48d172f49e9aeb9b73b49f54e0be4af3e14b9db (patch)
tree88fbd34759f5e007c8a01acb8df9ee2b6985858e /src/WorldStorage
parentChanged BroadcastSoundEffect function to take floating pos. (diff)
parentMerge pull request #1167 from Howaner/Plugins (diff)
downloadcuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar
cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.gz
cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.bz2
cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.lz
cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.xz
cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.tar.zst
cuberite-e48d172f49e9aeb9b73b49f54e0be4af3e14b9db.zip
Diffstat (limited to 'src/WorldStorage')
-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());
}