diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 5 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 11 | ||||
-rw-r--r-- | src/game/Unit.cpp | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index ea0aaeebd35..dc5dbe6b4ea 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1196,7 +1196,10 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if (GetSpellDuration(i->first)==-1) // get duration from aura-only once if (!_duration) - _duration = unit->GetAuraByCasterSpell(m_spellInfo->Id, m_caster->GetGUID())->GetAuraDuration(); + { + Aura * aur = unit->GetAuraByCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); + _duration = aur ? aur->GetAuraDuration() : -1; + } unit->SetAurasDurationByCasterSpell(i->first->Id, m_caster->GetGUID(), _duration); } } diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 086b944ea6d..7266f30f713 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -240,9 +240,8 @@ class TRINITY_DLL_SPEC Aura } void SetAuraDurationAndUpdate(int32 duration) { - m_duration = duration; - if(GetAuraSlot() < MAX_AURAS) // slot found send data to client - { m_target->UpdateAuraForGroup(GetAuraSlot()); } + SetAuraDuration (duration); + m_target->UpdateAuraForGroup(GetAuraSlot()); } time_t GetAuraApplyTime() { return m_applyTime; } @@ -269,16 +268,14 @@ class TRINITY_DLL_SPEC Aura if (m_procCharges == charges) return; m_procCharges = charges; - if(GetAuraSlot() < MAX_AURAS) // slot found send data to client - { m_target->UpdateAuraForGroup(GetAuraSlot()); } + m_target->UpdateAuraForGroup(GetAuraSlot()); } bool DropAuraCharge() // return true if last charge dropped { if (m_procCharges == 0) return false; m_procCharges--; - if(GetAuraSlot() < MAX_AURAS) // slot found send data to client - { m_target->UpdateAuraForGroup(GetAuraSlot()); } + m_target->UpdateAuraForGroup(GetAuraSlot()); return m_procCharges == 0; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ea9190335ad..ba88aa1cde3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4160,7 +4160,7 @@ void Unit::SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int3 { if(itr->second->GetCasterGUID()==casterGUID) { - itr->second->SetAuraDuration(duration); + itr->second->SetAuraDurationAndUpdate(duration); break; } } @@ -6027,7 +6027,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu if( spellProto->SpellFamilyName == SPELLFAMILY_ROGUE && spellProto->SpellFamilyFlags[0] & 0x40000) { - RefreshAurasByCasterSpell(spellProto->Id, GetGUID()); + SetAurasDurationByCasterSpell(spellProto->Id, GetGUID(), GetSpellMaxDuration(spellProto)); return true; } } |