diff options
author | Machiavelli <machiavelli.trinity@gmail.com> | 2013-08-30 20:59:29 +0100 |
---|---|---|
committer | Machiavelli <machiavelli.trinity@gmail.com> | 2013-08-30 20:59:29 +0100 |
commit | e3f27a36fe1e40cf3fde0541329536a7f34c6fd6 (patch) | |
tree | c921e0783fd536fd6f411b81749e3c1ea69e9292 /src | |
parent | 87e105c81836b46e2a307031bf0083fcc7f75f8b (diff) |
Core/Creatures: Fix base stats calculations for some cases.
i.e. health_mod of 0.001 resulting in hp of 0 instead of 1
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 34084dd662b..b720a063f2d 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -195,7 +195,7 @@ struct CreatureBaseStats uint32 GenerateHealth(CreatureTemplate const* info) const { - return uint32((BaseHealth[info->expansion] * info->ModHealth) + 0.5f); + return uint32(ceil(BaseHealth[info->expansion] * info->ModHealth)); } uint32 GenerateMana(CreatureTemplate const* info) const @@ -204,12 +204,12 @@ struct CreatureBaseStats if (!BaseMana) return 0; - return uint32((BaseMana * info->ModMana) + 0.5f); + return uint32(ceil(BaseMana * info->ModMana)); } uint32 GenerateArmor(CreatureTemplate const* info) const { - return uint32((BaseArmor * info->ModArmor) + 0.5f); + return uint32(ceil(BaseArmor * info->ModArmor)); } static CreatureBaseStats const* GetBaseStats(uint8 level, uint8 unitClass); |