diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 347d5ee5c..2f9cbfdba 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -798,16 +798,19 @@ bool Pet::CreateBaseAtCreature(Creature* creature) return true; } -bool Pet::InitStatsForLevel(uint32 petlevel) +bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) { CreatureInfo const *cinfo = GetCreatureInfo(); assert(cinfo); - Unit* owner = GetOwner(); if(!owner) { - sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry); - return false; + owner = GetOwner(); + if(!owner) + { + sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry); + return false; + } } uint32 creature_ID = (getPetType() == HUNTER_PET) ? 1 : cinfo->Entry; diff --git a/src/game/Pet.h b/src/game/Pet.h index f41b77710..bbe878d1d 100644 --- a/src/game/Pet.h +++ b/src/game/Pet.h @@ -161,7 +161,7 @@ class Pet : public Creature void GivePetXP(uint32 xp); void GivePetLevel(uint32 level); void SynchronizeLevelWithOwner(); - bool InitStatsForLevel(uint32 level); + bool InitStatsForLevel(uint32 level, Unit* owner = NULL); bool HaveInDiet(ItemPrototype const* item) const; uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel); void SetDuration(int32 dur) { m_duration = dur; } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5d39fab2b..bf69a6f0f 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3275,7 +3275,7 @@ void Spell::EffectSummon(uint32 i) spawnCreature->SetCreatorGUID(m_caster->GetGUID()); spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); - spawnCreature->InitStatsForLevel(level); + spawnCreature->InitStatsForLevel(level, m_caster); spawnCreature->GetCharmInfo()->SetPetNumber(pet_number, false); @@ -3705,7 +3705,7 @@ void Spell::EffectSummonGuardian(uint32 i) spawnCreature->SetCreatorGUID(m_caster->GetGUID()); spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); - spawnCreature->InitStatsForLevel(level); + spawnCreature->InitStatsForLevel(level, m_caster); spawnCreature->GetCharmInfo()->SetPetNumber(pet_number, false); spawnCreature->AIM_Initialize(); @@ -4195,7 +4195,7 @@ void Spell::EffectSummonPet(uint32 i) if(m_caster->IsPvP()) NewSummon->SetPvP(true); - NewSummon->InitStatsForLevel(petlevel); + NewSummon->InitStatsForLevel(petlevel, m_caster); NewSummon->InitPetCreateSpells(); NewSummon->InitLevelupSpellsForLevel(); NewSummon->InitTalentForLevel(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d5bedb68d..aca749e7e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8110" + #define REVISION_NR "8111" #endif // __REVISION_NR_H__