diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-24 22:15:48 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-24 22:15:48 +0200 |
commit | bd5df3d3b975c448e3d8f4227d86a742d0ad3b12 (patch) | |
tree | 30193169848d8ea39e2e5a423bd9e1a8e189c5f6 /src/WorldStorage/WSSAnvil.cpp | |
parent | Conforms to standards (diff) | |
parent | Merge pull request #1125 from Howaner/Entities (diff) | |
download | cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.gz cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.bz2 cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.lz cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.xz cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.tar.zst cuberite-bd5df3d3b975c448e3d8f4227d86a742d0ad3b12.zip |
Diffstat (limited to '')
-rw-r--r-- | src/WorldStorage/WSSAnvil.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index a3259b769..f714c0414 100644 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1461,13 +1461,6 @@ void cWSSAnvil::LoadPickupFromNBT(cEntityList & a_Entities, const cParsedNBT & a { return; } - - // Load health: - int Health = a_NBT.FindChildByName(a_TagIdx, "Health"); - if (Health > 0) - { - Pickup->SetHealth((int) (a_NBT.GetShort(Health) & 0xFF)); - } // Load age: int Age = a_NBT.FindChildByName(a_TagIdx, "Age"); @@ -1513,13 +1506,6 @@ void cWSSAnvil::LoadExpOrbFromNBT(cEntityList & a_Entities, const cParsedNBT & a return; } - // Load Health: - int Health = a_NBT.FindChildByName(a_TagIdx, "Health"); - if (Health > 0) - { - ExpOrb->SetHealth((int) (a_NBT.GetShort(Health) & 0xFF)); - } - // Load Age: int Age = a_NBT.FindChildByName(a_TagIdx, "Age"); if (Age > 0) @@ -2437,6 +2423,13 @@ bool cWSSAnvil::LoadEntityBaseFromNBT(cEntity & a_Entity, const cParsedNBT & a_N } a_Entity.SetYaw(Rotation[0]); a_Entity.SetRoll(Rotation[1]); + + // Load health: + int Health = a_NBT.FindChildByName(a_TagIdx, "Health"); + if (Health > 0) + { + a_Entity.SetHealth(a_NBT.GetShort(Health)); + } return true; } |