diff options
| author | TrullyONE <none@none> | 2008-12-19 05:02:51 +0200 |
|---|---|---|
| committer | TrullyONE <none@none> | 2008-12-19 05:02:51 +0200 |
| commit | 222999c225f175b67091f1ad55f36cf58cb55da9 (patch) | |
| tree | e4427bd2131d4b9fccb2cc48757153d61f2e5715 /src/game/Creature.cpp | |
| parent | a1c00a8dc502675124d8206df504ecb3c4665c48 (diff) | |
*Fixed creature initialize movement at respawn. Loot and tagging - correct set of dynamic flags.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Creature.cpp')
| -rw-r--r-- | src/game/Creature.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 3fc5598295a..0fb26de1321 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -407,9 +407,8 @@ void Creature::Update(uint32 diff) UpdateEntry(m_originalEntry); CreatureInfo const *cinfo = GetCreatureInfo(); - - SelectLevel(cinfo); - SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + SelectLevel(cinfo); + if (m_isDeadByDefault) { setDeathState(JUST_DIED); @@ -504,8 +503,14 @@ void Creature::Update(uint32 diff) if (m_regenTimer != 0) break; - if (!isInCombat() || IsPolymorphed()) - RegenerateHealth(); + if (!isInCombat()) + { + if(HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_OTHER_TAGGER)) + SetUInt32Value(UNIT_DYNAMIC_FLAGS, GetCreatureInfo()->dynamicflags); + RegenerateHealth(); + } + else if(IsPolymorphed()) + RegenerateHealth(); RegenerateMana(); @@ -1655,12 +1660,11 @@ void Creature::setDeathState(DeathState s) SetLootRecipient(NULL); Unit::setDeathState(ALIVE); CreatureInfo const *cinfo = GetCreatureInfo(); - SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); + RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); clearUnitState(UNIT_STAT_ALL_STATE); - i_motionMaster.Clear(); + i_motionMaster.Initialize(); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); LoadCreaturesAddon(true); } |
