mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
*Fix a crash in 3896.
--HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user