summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2014-06-24 16:23:55 +0200
committerworktycho <work.tycho@gmail.com>2014-06-24 16:23:55 +0200
commit03da9ae3c43c76eb7639980ddecc6edcdf7c7289 (patch)
tree5fe8cadca551313b76dee3c5f836b99ca99b7876 /src/WorldStorage/WSSAnvil.cpp
parentFixed BlockInfo initialization. (diff)
parentAdd entity health saving. (diff)
downloadcuberite-03da9ae3c43c76eb7639980ddecc6edcdf7c7289.tar
cuberite-03da9ae3c43c76eb7639980ddecc6edcdf7c7289.tar.gz
cuberite-03da9ae3c43c76eb7639980ddecc6edcdf7c7289.tar.bz2
cuberite-03da9ae3c43c76eb7639980ddecc6edcdf7c7289.tar.lz
cuberite-03da9ae3c43c76eb7639980ddecc6edcdf7c7289.tar.xz
cuberite-03da9ae3c43c76eb7639980ddecc6edcdf7c7289.tar.zst
cuberite-03da9ae3c43c76eb7639980ddecc6edcdf7c7289.zip
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rw-r--r--src/WorldStorage/WSSAnvil.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 0f84a0eb1..9870c144a 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;
}