*Fix a crash in 3896.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-10 09:46:32 -05:00
parent a6e1e7d9e7
commit b0fa2172e3
2 changed files with 3 additions and 3 deletions

View File

@@ -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);

View File

@@ -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; }