aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-02-28 21:34:31 +0100
committerTrazom62 <none@none>2010-02-28 21:34:31 +0100
commit4c16bff8e62ca894f6411767706a74d687d04309 (patch)
treee53c1e72378c99618bfddb584641dfe3927fba81 /src/game/Unit.cpp
parent3ffeb5f5dddac4ec7314b28d9829f34f95b5f191 (diff)
Fix mana set to 0 when mob dies. Thanks Malcrom.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 60cc59a1311..644b2430b6f 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -658,7 +658,6 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
if (damage >= pVictim->GetHealth())
{
pVictim->setDeathState(JUST_DIED);
- pVictim->SetHealth(0);
CreatureInfo const* cInfo = ((Creature*)pVictim)->GetCreatureInfo();
if (cInfo && cInfo->lootid)
@@ -11997,6 +11996,7 @@ void Unit::setDeathState(DeathState s)
//without this when removing IncreaseMaxHealth aura player may stuck with 1 hp
//do not why since in IncreaseMaxHealth currenthealth is checked
SetHealth(0);
+ SetPower(getPowerType(),0);
}
else if (s == JUST_ALIVED)
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground)
@@ -14550,8 +14550,6 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss)
//sLog.outError("%u kill %u", GetEntry(), pVictim->GetEntry());
- pVictim->SetHealth(0);
-
// find player: owner of controlled `this` or `this` itself maybe
Player *player = GetCharmerOrOwnerPlayerOrPlayerItself();