[7780] Fixed Player::HasGuardianWithEntry()

Pets not contain in GUID entry but pet number so we need check
GetEntry() == entry

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-05-05 23:33:56 +02:00
parent da04a946e7
commit e8d8b1a888
2 changed files with 6 additions and 3 deletions

View file

@ -16194,8 +16194,11 @@ bool Player::HasGuardianWithEntry(uint32 entry)
// pet guid middle part is entry (and creature also) // pet guid middle part is entry (and creature also)
// and in guardian list must be guardians with same entry _always_ // 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(GUID_ENPART(*itr)==entry) {
return true; if(Pet* pet = ObjectAccessor::GetPet(*itr))
if (Pet->GetEntry() == entry)
return true;
}
return false; return false;
} }

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7779" #define REVISION_NR "7780"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__