diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-05-27 03:14:25 -0300 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2020-06-14 23:49:04 +0200 |
commit | f1eb73001cdd1b1a94109e89ad0c6b84a1aabc3c (patch) | |
tree | dd8f5af0819144e21127292f592c0ff88033f2b7 | |
parent | 6fa8b8e1d57f992e14eec3b511bf827ebdd1c9ea (diff) |
Core/Spell: fixed some problems with per caster aura states
- Update clients whenever target has more than one application of an aura that applies such aurastate
- Update again when one application gets removed
- Fixed Fire and Brimstone computing damage if any warlock applied the Immolate (should only count for own)
Closes #19790
(cherry picked from commit e27c385b48fce359a168d602dabae8c55fa85563)
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2c9ce8d7d17..02469f0ed86 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3391,7 +3391,14 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint32 effMask) // Update target aura state flag if (AuraStateType aState = aura->GetSpellInfo()->GetAuraState()) - ModifyAuraState(aState, true); + { + uint32 aStateMask = (1 << (aState - 1)); + // force update so the new caster registers it + if ((aStateMask & PER_CASTER_AURA_STATE_MASK) && *m_unitData->AuraState & aStateMask) + ForceUpdateFieldChange(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::AuraState)); + else + ModifyAuraState(aState, true); + } if (aurApp->GetRemoveMode()) return; @@ -3484,9 +3491,19 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo ToTotem()->setDeathState(JUST_DIED); } - // Remove aurastates only if were not found - if (!auraStateFound) - ModifyAuraState(auraState, false); + // Remove aurastates only if needed and were not found + if (auraState) + { + if (!auraStateFound) + ModifyAuraState(auraState, false); + else + { + // update for casters, some shouldn't 'see' the aura state + uint32 aStateMask = (1 << (auraState - 1)); + if ((aStateMask & PER_CASTER_AURA_STATE_MASK) != 0) + ForceUpdateFieldChange(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::AuraState)); + } + } aura->HandleAuraSpecificMods(aurApp, caster, false, false); |