diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index ed66354336b..4060628e3b3 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1213,10 +1213,10 @@ class Unit : public WorldObject uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); } inline bool IsFullHealth() const { return GetHealth() == GetMaxHealth(); } - inline bool HealthBelowPct(int32 pct) const { return GetHealth() * 100 < GetMaxHealth() * pct; } - inline bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return (int32(GetHealth()) - damage) * 100 < GetMaxHealth() * pct; } - inline bool HealthAbovePct(int32 pct) const { return GetHealth() * 100 > GetMaxHealth() * pct; } - inline float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; } + inline bool HealthBelowPct(uint32 pct) const { return GetHealth() * (uint64)100 < GetMaxHealth() * (uint64)pct; } + inline bool HealthBelowPctDamaged(uint32 pct, uint32 damage) const { return (int32(GetHealth()) - damage) * (int64)100 < GetMaxHealth() * (int64)pct; } + inline bool HealthAbovePct(uint32 pct) const { return GetHealth() * (uint64)100 > GetMaxHealth() * (uint64)pct; } + inline float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; } inline uint32 CountPctFromMaxHealth(int32 pct) const { return uint32(float(pct) * GetMaxHealth() / 100.0f); } void SetHealth(uint32 val); |
