[9197] More propertly update walk mode for player pets.

* Use AddMonsterMoveFlag instead SetMonsterMoveFlags for set walk-mode
* Apply walk/run mode to all copntrolled units (except totems).
* Synchronize walk/run mode at pet creating/loading.
This commit is contained in:
VladimirMangos 2010-01-17 07:48:04 +03:00
parent b0809f63b2
commit 2e9bf5ad6a
6 changed files with 43 additions and 25 deletions

View file

@ -3548,6 +3548,9 @@ void Spell::EffectSummon(uint32 i)
spawnCreature->InitStatsForLevel(level, m_caster);
spawnCreature->GetCharmInfo()->SetPetNumber(pet_number, false);
if (m_caster->GetTypeId() == TYPEID_PLAYER)
spawnCreature->UpdateWalkModeForPets(((Player*)m_caster)->HasMovementFlag(MOVEMENTFLAG_WALK_MODE));
spawnCreature->AIM_Initialize();
spawnCreature->InitPetCreateSpells();
@ -4415,6 +4418,9 @@ void Spell::EffectSummonPet(uint32 i)
NewSummon->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);
NewSummon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
if (m_caster->GetTypeId() == TYPEID_PLAYER)
NewSummon->UpdateWalkModeForPets(((Player*)m_caster)->HasMovementFlag(MOVEMENTFLAG_WALK_MODE));
NewSummon->GetCharmInfo()->SetPetNumber(pet_number, true);
// this enables pet details window (Shift+P)