diff options
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
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); |