1
0

Slight cleanup after portals

This commit is contained in:
Tiger Wang
2014-07-29 20:50:30 +01:00
parent 30e64ed4d8
commit 4f5d73b770
8 changed files with 14 additions and 20 deletions

View File

@@ -2475,10 +2475,7 @@ bool cWSSAnvil::LoadEntityBaseFromNBT(cEntity & a_Entity, const cParsedNBT & a_N
// Load health:
int Health = a_NBT.FindChildByName(a_TagIdx, "Health");
if (Health > 0)
{
a_Entity.SetHealth(a_NBT.GetShort(Health));
}
a_Entity.SetHealth(Health > 0 ? a_NBT.GetShort(Health) : a_Entity.GetMaxHealth());
return true;
}
@@ -2507,8 +2504,6 @@ bool cWSSAnvil::LoadMonsterBaseFromNBT(cMonster & a_Monster, const cParsedNBT &
a_Monster.SetCanPickUpLoot(CanPickUpLoot);
}
int HealthTag = a_NBT.FindChildByName(a_TagIdx, "Health");
a_Monster.SetHealth(HealthTag > 0 ? a_NBT.GetShort(HealthTag) : a_Monster.GetMaxHealth());
return true;
}