diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 03dfb6b5e..194add4d0 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1281,7 +1281,7 @@ void Pet::_LoadAuras(uint32 timediff) do { Field *fields = result->Fetch(); - uint64 caster_guid = fields[0].GetUInt64(); + ObjectGuid casterGuid = ObjectGuid(fields[0].GetUInt64()); uint32 item_lowguid = fields[1].GetUInt32(); uint32 spellid = fields[2].GetUInt32(); uint32 stackcount = fields[3].GetUInt32(); @@ -1307,7 +1307,7 @@ void Pet::_LoadAuras(uint32 timediff) } // do not load single target auras (unless they were cast by the player) - if (caster_guid != GetGUID() && IsSingleTargetSpell(spellproto)) + if (casterGuid != GetObjectGuid() && IsSingleTargetSpell(spellproto)) continue; if (remaintime != -1 && !IsPositiveSpell(spellproto)) @@ -1336,7 +1336,7 @@ void Pet::_LoadAuras(uint32 timediff) stackcount = 1; SpellAuraHolder *holder = CreateSpellAuraHolder(spellproto, this, NULL); - holder->SetLoadedState(caster_guid, ObjectGuid(HIGHGUID_ITEM, item_lowguid), stackcount, remaincharges, maxduration, remaintime); + holder->SetLoadedState(casterGuid, ObjectGuid(HIGHGUID_ITEM, item_lowguid), stackcount, remaincharges, maxduration, remaintime); for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i) { diff --git a/src/game/PetAI.cpp b/src/game/PetAI.cpp index 0c4a99621..ae9b2eaad 100644 --- a/src/game/PetAI.cpp +++ b/src/game/PetAI.cpp @@ -250,15 +250,15 @@ void PetAI::UpdateAI(const uint32 diff) else { bool spellUsed = false; - for(std::set::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) + for (AllySet::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) { Unit* Target = ObjectAccessor::GetUnit(*m_creature,*tar); //only buff targets that are in combat, unless the spell can only be cast while out of combat - if(!Target) + if (!Target) continue; - if(spell->CanAutoCast(Target)) + if (spell->CanAutoCast(Target)) { targetSpellStore.push_back(std::make_pair(Target, spell)); spellUsed = true; @@ -317,36 +317,36 @@ void PetAI::UpdateAllies() m_updateAlliesTimer = 10*IN_MILLISECONDS; //update friendly targets every 10 seconds, lesser checks increase performance - if(!owner) + if (!owner) return; - else if(owner->GetTypeId() == TYPEID_PLAYER) + else if (owner->GetTypeId() == TYPEID_PLAYER) pGroup = ((Player*)owner)->GetGroup(); //only pet and owner/not in group->ok - if(m_AllySet.size() == 2 && !pGroup) + if (m_AllySet.size() == 2 && !pGroup) return; //owner is in group; group members filled in already (no raid -> subgroupcount = whole count) - if(pGroup && !pGroup->isRaidGroup() && m_AllySet.size() == (pGroup->GetMembersCount() + 2)) + if (pGroup && !pGroup->isRaidGroup() && m_AllySet.size() == (pGroup->GetMembersCount() + 2)) return; m_AllySet.clear(); - m_AllySet.insert(m_creature->GetGUID()); - if(pGroup) //add group + m_AllySet.insert(m_creature->GetObjectGuid()); + if (pGroup) //add group { - for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { Player* Target = itr->getSource(); - if(!Target || !pGroup->SameSubGroup((Player*)owner, Target)) + if (!Target || !pGroup->SameSubGroup((Player*)owner, Target)) continue; - if(Target->GetGUID() == owner->GetGUID()) + if (Target->GetGUID() == owner->GetGUID()) continue; - m_AllySet.insert(Target->GetGUID()); + m_AllySet.insert(Target->GetObjectGuid()); } } else //remove group - m_AllySet.insert(owner->GetGUID()); + m_AllySet.insert(owner->GetObjectGuid()); } void PetAI::AttackedBy(Unit *attacker) diff --git a/src/game/PetAI.h b/src/game/PetAI.h index d510fdafe..4bf1a3216 100644 --- a/src/game/PetAI.h +++ b/src/game/PetAI.h @@ -49,7 +49,9 @@ class MANGOS_DLL_DECL PetAI : public CreatureAI TimeTracker i_tracker; bool inCombat; - std::set m_AllySet; + + typedef std::set AllySet; + AllySet m_AllySet; uint32 m_updateAlliesTimer; }; #endif diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 61e7cae5f..5641d1590 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 "11455" + #define REVISION_NR "11456" #endif // __REVISION_NR_H__