diff options
author | Tartalo <none@none> | 2010-06-28 20:32:56 +0200 |
---|---|---|
committer | Tartalo <none@none> | 2010-06-28 20:32:56 +0200 |
commit | 5d3a529e848c4fd3fa2e7d99a8dd53349adb1437 (patch) | |
tree | 37169ad02b5af22dd76e68194158db3268e5ded8 | |
parent | bb6d8a7e674529006c97c7c902990fe04ef4c417 (diff) | |
parent | d2f6ae6f778138643a8f0af621ad9a7e9015ecd3 (diff) |
Merge
--HG--
branch : trunk
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index f51b7a585bd..f1f5e7729a1 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1262,16 +1262,26 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) } } - uint32 curhealth = data->curhealth; - if (curhealth) + uint32 curhealth; + + if (!m_regenHealth) { - curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank)); - if (curhealth < 1) - curhealth = 1; + curhealth = data->curhealth; + if (curhealth) + { + curhealth = uint32(curhealth*_GetHealthMod(GetCreatureInfo()->rank)); + if (curhealth < 1) + curhealth = 1; + } + SetPower(POWER_MANA,data->curmana); + } + else + { + curhealth = GetMaxHealth(); + SetPower(POWER_MANA,GetMaxPower(POWER_MANA)); } SetHealth(m_deathState == ALIVE ? curhealth : 0); - SetPower(POWER_MANA,data->curmana); // checked at creature_template loading m_defaultMovementType = MovementGeneratorType(data->movementType); |