From 746e170e2b7a774a41929dc1b9f82a7fad7791f8 Mon Sep 17 00:00:00 2001 From: click Date: Fri, 16 Apr 2010 19:20:27 +0200 Subject: [PATCH] *Fix: Pets now properly avoid doublestacking talentbased auras where they shouldn't This also removes the double-filed entries in pet_auras, meaning no more SQL-complaints in the server logs regarding duplicates Also fixes (properly) pets losing/readding pet auras when dismissed/lost on a boat/lost on flightpath usage Fix by click and Liberate --HG-- branch : trunk --- src/game/Pet.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 1f15cab514..ee96d7de9e 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1945,12 +1945,10 @@ bool Pet::IsPetAura(Aura const* aura) if (!owner || owner->GetTypeId() != TYPEID_PLAYER) return false; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + // if the owner has that pet aura, return true + for (PetAuraSet::const_iterator itr = owner->m_petAuras.begin(); itr != owner->m_petAuras.end(); ++itr) { - PetAura const* pa = spellmgr.GetPetAura(aura->GetId(),i); - - // if the owner has that pet aura, return true - if (owner->m_petAuras.find(pa) != owner->m_petAuras.end()) + if ((*itr)->GetAura(GetEntry()) == aura->GetId()) return true; } return false;