From 0dd172b80ffc949cf87119ad2003589d7eb82c46 Mon Sep 17 00:00:00 2001 From: Fabian Date: Wed, 22 Nov 2017 14:47:52 +0100 Subject: Store Health as a float (#4073) * Fix #4024 * Fix clang error * Add comment * Fix behaviour * Save Health as float * Changed m_Health to float * Remove redundant static_cast * Fix casts --- src/Entities/Entity.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Entities/Entity.h') diff --git a/src/Entities/Entity.h b/src/Entities/Entity.h index 4174160bf..fae296ab4 100644 --- a/src/Entities/Entity.h +++ b/src/Entities/Entity.h @@ -368,10 +368,10 @@ public: virtual void Heal(int a_HitPoints); /** Returns the health of this entity */ - int GetHealth(void) const { return m_Health; } + float GetHealth(void) const { return m_Health; } /** Sets the health of this entity; doesn't broadcast any hurt animation */ - void SetHealth(int a_Health); + void SetHealth(float a_Health); // tolua_end @@ -403,9 +403,9 @@ public: // tolua_begin /** Sets the maximum value for the health */ - void SetMaxHealth(int a_MaxHealth); + void SetMaxHealth(float a_MaxHealth); - int GetMaxHealth(void) const { return m_MaxHealth; } + float GetMaxHealth(void) const { return m_MaxHealth; } /** Sets whether the entity is fireproof */ void SetIsFireproof(bool a_IsFireproof); @@ -556,8 +556,8 @@ protected: Note that the UniqueID is not persisted through storage. */ UInt32 m_UniqueID; - int m_Health; - int m_MaxHealth; + float m_Health; + float m_MaxHealth; /** The entity to which this entity is attached (vehicle), nullptr if none */ cEntity * m_AttachedTo; -- cgit v1.2.3