aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellAuras.cpp6
-rw-r--r--src/game/SpellMgr.cpp2
-rw-r--r--src/game/Unit.cpp31
-rw-r--r--src/game/Unit.h1
4 files changed, 21 insertions, 19 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index fe16e488b3d..d31ec2ff553 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -459,12 +459,6 @@ m_updated(false), m_isRemovedOnShapeLost(true), m_in_use(false)
Aura::~Aura()
{
- //Delete references to aura
- if(GetAuraSlot() < MAX_AURAS && m_target && m_target->GetVisibleAura(GetAuraSlot()))
- {
- AuraSlotEntry * entry = m_target->GetVisibleAura(GetAuraSlot());
- entry->m_slotAuras[GetEffIndex()]=NULL;
- }
}
AreaAura::AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target,
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 5498c802f87..95a52acf57c 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -2884,7 +2884,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto
if (mechanic & (1<<MECHANIC_FEAR)) return DIMINISHING_FEAR;
if (mechanic & (1<<MECHANIC_CHARM)) return DIMINISHING_CHARM;
if (mechanic & (1<<MECHANIC_SILENCE)) return DIMINISHING_SILENCE;
- if (mechanic & (1<<DIMINISHING_DISARM)) return DIMINISHING_DISARM;
+ if (mechanic & (1<<MECHANIC_DISARM)) return DIMINISHING_DISARM;
if (mechanic & (1<<MECHANIC_FREEZE)) return DIMINISHING_FREEZE;
if (mechanic & ((1<<MECHANIC_KNOCKOUT) | (1<<MECHANIC_SAPPED))) return DIMINISHING_KNOCKOUT;
if (mechanic & (1<<MECHANIC_BANISH)) return DIMINISHING_BANISH;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 55779378428..4e24fa723c7 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -208,18 +208,7 @@ void Unit::Update( uint32 p_time )
_UpdateAura();
}else
m_AurasCheck -= p_time;*/
- const uint64& auramask = GetAuraUpdateMask();
- if (auramask)
- {
- for(uint32 i = 0; i < MAX_AURAS; ++i)
- {
- if(auramask & (uint64(1) << i))
- {
- SendAuraUpdate(i);
- }
- }
- ResetAuraUpdateMask();
- }
+ UpdateAuras();
// WARNING! Order of execution here is important, do not change.
// Spells must be processed with event system BEFORE they go to _UpdateSpells.
@@ -264,6 +253,22 @@ void Unit::Update( uint32 p_time )
i_motionMaster.UpdateMotion(p_time);
}
+void UpdateAuras()
+{
+ const uint64& auramask = GetAuraUpdateMask();
+ if (auramask)
+ {
+ for(uint32 i = 0; i < MAX_AURAS; ++i)
+ {
+ if(auramask & (uint64(1) << i))
+ {
+ SendAuraUpdate(i);
+ }
+ }
+ ResetAuraUpdateMask();
+ }
+}
+
bool Unit::haveOffhandWeapon() const
{
if(GetTypeId() == TYPEID_PLAYER)
@@ -9855,6 +9860,8 @@ void Unit::setDeathState(DeathState s)
{
RemoveAllAurasOnDeath();
UnsummonAllTotems();
+ //This is needed to clear visible auras after unit dies
+ UpdateAuras();
ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
diff --git a/src/game/Unit.h b/src/game/Unit.h
index c2c8c4bf403..95d21159207 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -865,6 +865,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry);
virtual void Update( uint32 time );
+ void UpdateAuras();
void setAttackTimer(WeaponAttackType type, uint32 time) { m_attackTimer[type] = time; }
void resetAttackTimer(WeaponAttackType type = BASE_ATTACK);