aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2008-12-27 22:24:29 +0100
committerQAston <none@none>2008-12-27 22:24:29 +0100
commit231cb0f5a7707017cd37628c389c32e42f24f1fe (patch)
treeefde6463a533e59ab23d0e21b130abddf0f297b6
parent46bc9c343e04bf42ce7ae6073f862f30cdd7c02d (diff)
*Remove aura slot from update fields at aura remove.
--HG-- branch : trunk
-rw-r--r--src/game/Pet.h1
-rw-r--r--src/game/Player.h1
-rw-r--r--src/game/SpellAuras.cpp4
-rw-r--r--src/game/Unit.cpp12
-rw-r--r--src/game/Unit.h2
5 files changed, 14 insertions, 6 deletions
diff --git a/src/game/Pet.h b/src/game/Pet.h
index 1057abc0edf..9d187b24b45 100644
--- a/src/game/Pet.h
+++ b/src/game/Pet.h
@@ -235,6 +235,7 @@ class Pet : public Creature
uint64 GetAuraUpdateMask() { return m_auraUpdateMask; }
void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
+ void UnsetAuraUpdateMask(uint8 slot) { m_auraUpdateMask &= ~(uint64(1) << slot); }
void ResetAuraUpdateMask() { m_auraUpdateMask = 0; }
DeclinedName const* GetDeclinedNames() const { return m_declinedname; }
diff --git a/src/game/Player.h b/src/game/Player.h
index 9187ca3968d..c97f771190e 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2069,6 +2069,7 @@ class TRINITY_DLL_SPEC Player : public Unit
void SetGroupUpdateFlag(uint32 flag) { m_groupUpdateMask |= flag; }
uint64 GetAuraUpdateMask() { return m_auraUpdateMask; }
void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
+ void UnsetAuraUpdateMask(uint8 slot) { m_auraUpdateMask &= ~(uint64(1) << slot); }
Player* GetNextRandomRaidMember(float radius);
PartyResult CanUninviteFromGroup() const;
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 36e62831f61..d22266f2e15 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -886,7 +886,7 @@ void Aura::_AddAura()
UpdateAuraCharges();
// update for out of range group members
- m_target->UpdateAuraForGroup(slot);
+ m_target->UpdateAuraForGroup(slot, true);
}
}
else // use found slot
@@ -973,7 +973,7 @@ void Aura::_RemoveAura()
SetAuraApplication(slot, 0);
// update for out of range group members
- m_target->UpdateAuraForGroup(slot);
+ m_target->UpdateAuraForGroup(slot, false);
if( IsSealSpell(GetSpellProto()) )
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT,false);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 8e81c11582b..b726e78c69e 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12286,7 +12286,7 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT
return CastingTime;
}
-void Unit::UpdateAuraForGroup(uint8 slot)
+void Unit::UpdateAuraForGroup(uint8 slot, bool apply)
{
if(GetTypeId() == TYPEID_PLAYER)
{
@@ -12294,7 +12294,10 @@ void Unit::UpdateAuraForGroup(uint8 slot)
if(player->GetGroup())
{
player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_AURAS);
- player->SetAuraUpdateMask(slot);
+ if(apply)
+ player->SetAuraUpdateMask(slot);
+ else
+ player->UnsetAuraUpdateMask(slot);
}
}
else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet())
@@ -12306,7 +12309,10 @@ void Unit::UpdateAuraForGroup(uint8 slot)
if(owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup())
{
((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_AURAS);
- pet->SetAuraUpdateMask(slot);
+ if(apply)
+ pet->SetAuraUpdateMask(slot);
+ else
+ pet->UnsetAuraUpdateMask(slot);
}
}
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index c3f5be3adb1..2f1af0c32d8 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1392,7 +1392,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void UpdateReactives(uint32 p_time);
// group updates
- void UpdateAuraForGroup(uint8 slot);
+ void UpdateAuraForGroup(uint8 slot, bool apply);
// pet auras
typedef std::set<PetAura const*> PetAuraSet;