diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp index 0097a23b2..12f56843c 100644 --- a/src/game/GroupHandler.cpp +++ b/src/game/GroupHandler.cpp @@ -25,6 +25,7 @@ #include "World.h" #include "ObjectMgr.h" #include "Player.h" +#include "SpellAuras.h" #include "Group.h" #include "SocialMgr.h" #include "Util.h" @@ -736,7 +737,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke { if (auramask & (uint64(1) << i)) { - *data << uint32(player->GetVisibleAura(i)); + *data << uint32(player->GetVisibleAura(i)->GetId()); *data << uint8(1); } } @@ -812,7 +813,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke { if (auramask & (uint64(1) << i)) { - *data << uint32(pet->GetVisibleAura(i)); + *data << uint32(pet->GetVisibleAura(i)->GetId()); *data << uint8(1); } } @@ -893,7 +894,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data) data << uint64(auramask); // placeholder for (uint8 i = 0; i < MAX_AURAS; ++i) { - if (uint32 aura = player->GetVisibleAura(i)) + if (uint32 aura = player->GetVisibleAura(i)->GetId()) { auramask |= (uint64(1) << i); data << uint32(aura); @@ -919,7 +920,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data) data << uint64(petauramask); // placeholder for (uint8 i = 0; i < MAX_AURAS; ++i) { - if (uint32 petaura = pet->GetVisibleAura(i)) + if (uint32 petaura = pet->GetVisibleAura(i)->GetId()) { petauramask |= (uint64(1) << i); data << uint32(petaura); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 442049562..770ba8493 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -20827,11 +20827,7 @@ void Player::SendAurasForTarget(Unit* target) Unit::VisibleAuraMap const& visibleAuras = target->GetVisibleAuras(); for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras.begin(); itr != visibleAuras.end(); ++itr) - { - SpellAuraHolderConstBounds bounds = target->GetSpellAuraHolderBounds(itr->second); - for (SpellAuraHolderMap::const_iterator iter = bounds.first; iter != bounds.second; ++iter) - iter->second->BuildUpdatePacket(data); - } + itr->second->BuildUpdatePacket(data); GetSession()->SendPacket(&data); } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 44529a46a..f78c435d7 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -8984,7 +8984,7 @@ void SpellAuraHolder::_RemoveSpellAuraHolder() if (slot >= MAX_AURAS) // slot not set return; - if (m_target->GetVisibleAura(slot) == 0) + if (!m_target->GetVisibleAura(slot)) return; // unregister aura diminishing (and store last time) @@ -9278,6 +9278,8 @@ void SpellAuraHolder::BuildUpdatePacket(WorldPacket& data) const if (auraFlags & (1 << i)) if (Aura const* aura = m_auras[i]) data << int32(aura->GetModifier()->m_amount); + else + data << int32(0); } } diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 9c29b7335..afdacc4dd 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -143,7 +143,7 @@ class MANGOS_DLL_SPEC SpellAuraHolder time_t GetAuraApplyTime() const { return m_applyTime; } - void SetVisibleAura(bool remove) { m_target->SetVisibleAura(m_auraSlot, remove ? 0 : GetId()); } + void SetVisibleAura(bool remove) { m_target->SetVisibleAura(m_auraSlot, remove ? NULL : this); } void SetRemoveMode(AuraRemoveMode mode) { m_removeMode = mode; } void SetLoadedState(ObjectGuid const& casterGUID, ObjectGuid const& itemGUID, uint32 stackAmount, uint32 charges, int32 maxduration, int32 duration) { diff --git a/src/game/Unit.h b/src/game/Unit.h index 2b96c7e2c..c5e2f6f3b 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1128,7 +1128,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject typedef std::list AuraList; typedef std::list Diminishing; typedef std::set ComboPointHolderSet; - typedef std::map VisibleAuraMap; + typedef std::map VisibleAuraMap; typedef std::map SingleCastSpellTargetMap; virtual ~Unit(); @@ -1728,19 +1728,19 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void removeHatedBy(HostileReference* /*pHostileReference*/) { /* nothing to do yet */ } HostileRefManager& getHostileRefManager() { return m_HostileRefManager; } - uint32 GetVisibleAura(uint8 slot) const + SpellAuraHolder* GetVisibleAura(uint8 slot) const { VisibleAuraMap::const_iterator itr = m_visibleAuras.find(slot); if (itr != m_visibleAuras.end()) return itr->second; return 0; } - void SetVisibleAura(uint8 slot, uint32 spellid) + void SetVisibleAura(uint8 slot, SpellAuraHolder* holder) { - if (spellid == 0) + if (!holder) m_visibleAuras.erase(slot); else - m_visibleAuras[slot] = spellid; + m_visibleAuras[slot] = holder; } VisibleAuraMap const& GetVisibleAuras() const { return m_visibleAuras; } uint8 GetVisibleAurasCount() const { return m_visibleAuras.size(); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ef02682aa..538fb22bf 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 "0177" +#define REVISION_NR "0179" #endif // __REVISION_NR_H__