diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Creature.cpp | 2 | ||||
-rw-r--r-- | src/game/Creature.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 4e4cd734d5f..e8916aad70a 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -153,7 +153,6 @@ m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL), m_summo m_GlobalCooldown = 0; m_unit_movement_flags = MOVEMENTFLAG_WALK_MODE; DisableReputationGain = false; - ResetDamageByPlayers(); } Creature::~Creature() @@ -1352,6 +1351,7 @@ void Creature::SelectLevel(const CreatureInfo *cinfo) SetCreateHealth(health); SetMaxHealth(health); SetHealth(health); + ResetDamageByPlayers(); // mana uint32 minmana = std::min(cinfo->maxmana, cinfo->minmana); diff --git a/src/game/Creature.h b/src/game/Creature.h index 4249e497c4b..7ec203d8f3b 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -725,10 +725,10 @@ class TRINITY_DLL_SPEC Creature : public Unit bool IsDamageEnoughForLootingAndReward() { return m_PlayerDamageReq == 0; } void AddDamageByPlayers(uint32 unDamage) { - if(m_PlayerDamageReq > 0) + if(m_PlayerDamageReq) m_PlayerDamageReq > unDamage ? m_PlayerDamageReq -= unDamage : m_PlayerDamageReq = 0; } - void ResetDamageByPlayers() { m_PlayerDamageReq = (uint32)(GetHealth() *50 / GetMaxHealth()); } + void ResetDamageByPlayers() { m_PlayerDamageReq = GetHealth() / 2; } uint32 m_PlayerDamageReq; void SetOriginalEntry(uint32 entry) { m_originalEntry = entry; } |