mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[10735] Fixed spell 51420 work by use recently added protector pets as expected.
Thanks to NoFantasy for problem research (and prev. new pet type adding case research aslo) ;)
This commit is contained in:
parent
98d19f4d07
commit
876458c6e4
4 changed files with 16 additions and 11 deletions
|
|
@ -1541,13 +1541,8 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
|
||||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
|
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
// only spell related protector pets exist currently
|
||||||
return;
|
Pet* pPet = m_caster->GetProtectorPet();
|
||||||
|
|
||||||
// Not expecting any MINI_PET here, the ones used for related quests are
|
|
||||||
// fighting "companions" (effMiscValueB 387). Needs to be corrected.
|
|
||||||
Pet* pPet = ((Player*)m_caster)->GetMiniPet();
|
|
||||||
|
|
||||||
if (!pPet)
|
if (!pPet)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5909,11 +5909,20 @@ void Unit::RemoveGuardians()
|
||||||
|
|
||||||
Pet* Unit::FindGuardianWithEntry(uint32 entry)
|
Pet* Unit::FindGuardianWithEntry(uint32 entry)
|
||||||
{
|
{
|
||||||
// pet guid middle part is entry (and creature also)
|
|
||||||
// and in guardian list must be guardians with same entry _always_
|
|
||||||
for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
|
for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
|
||||||
if(Pet* pet = GetMap()->GetPet(*itr))
|
if(Pet* pet = GetMap()->GetPet(*itr))
|
||||||
if (pet->GetEntry() == entry)
|
if (pet->getPetType() == entry)
|
||||||
|
return pet;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Pet* Unit::GetProtectorPet()
|
||||||
|
{
|
||||||
|
for(GuardianPetList::const_iterator itr = m_guardianPets.begin(); itr != m_guardianPets.end(); ++itr)
|
||||||
|
if(Pet* pet = GetMap()->GetPet(*itr))
|
||||||
|
if (pet->getPetType() == PROTECTOR_PET)
|
||||||
return pet;
|
return pet;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
|
|
@ -1532,6 +1532,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
void RemoveGuardian(Pet* pet);
|
void RemoveGuardian(Pet* pet);
|
||||||
void RemoveGuardians();
|
void RemoveGuardians();
|
||||||
Pet* FindGuardianWithEntry(uint32 entry);
|
Pet* FindGuardianWithEntry(uint32 entry);
|
||||||
|
Pet* GetProtectorPet(); // expected single case in guardian list
|
||||||
|
|
||||||
bool isCharmed() const { return !GetCharmerGuid().IsEmpty(); }
|
bool isCharmed() const { return !GetCharmerGuid().IsEmpty(); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10734"
|
#define REVISION_NR "10735"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue