From e3f27a36fe1e40cf3fde0541329536a7f34c6fd6 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Fri, 30 Aug 2013 20:59:29 +0100 Subject: Core/Creatures: Fix base stats calculations for some cases. i.e. health_mod of 0.001 resulting in hp of 0 instead of 1 --- src/server/game/Entities/Creature/Creature.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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); -- cgit v1.2.3