Skip to content

Commit

Permalink
Fix updating all stats for pets in all summoning scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife authored and cyberium committed Jan 10, 2017
1 parent f52e8a5 commit 321e5fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/game/Pet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry /*= 0*/, uint32 petnumber
CastPetAuras(current);
CastOwnerTalentAuras();
InitTamedPetPassives(owner);
UpdateAllStats();

// failsafe check
savedhealth = savedhealth > GetMaxHealth() ? GetMaxHealth() : savedhealth;
Expand Down
11 changes: 10 additions & 1 deletion src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6705,8 +6705,12 @@ void Spell::EffectTameCreature(SpellEffectIndex /*eff_idx*/)
// this enables pet details window (Shift+P)
pet->InitPetCreateSpells();

// this add special Tamed Pet aura
// this add pet auras
pet->LearnPetPassives();
pet->CastPetAuras(true);
pet->CastOwnerTalentAuras();
pet->InitTamedPetPassives(m_caster);
pet->UpdateAllStats();

// caster have pet now
plr->SetPet(pet);
Expand Down Expand Up @@ -6781,7 +6785,12 @@ void Spell::EffectSummonPet(SpellEffectIndex eff_idx)
NewSummon->InitPetCreateSpells();
NewSummon->InitLevelupSpellsForLevel();
NewSummon->InitTalentForLevel();

NewSummon->LearnPetPassives();
NewSummon->CastPetAuras(true);
NewSummon->CastOwnerTalentAuras();
NewSummon->InitTamedPetPassives(m_caster);
NewSummon->UpdateAllStats();

map->Add((Creature*)NewSummon);
NewSummon->AIM_Initialize();
Expand Down

0 comments on commit 321e5fc

Please sign in to comment.