mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[8994] Re-implement remove auras from channeled target
* Old way have problem with auras that have last tick avent at one from caster/target: depndent from auras update order in caster/target pair ti can wrongly not triggered. * Fxied possible problem with remove same spell non-caster auras at target/caster at spell cast cancel * Also fix memory lost in old deleted auras cleanup.
This commit is contained in:
parent
8211bcd218
commit
be79375b56
4 changed files with 25 additions and 42 deletions
|
|
@ -2417,11 +2417,10 @@ void Spell::cancel()
|
|||
{
|
||||
Unit* unit = m_caster->GetGUID()==(*ihit).targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
|
||||
if( unit && unit->isAlive() )
|
||||
unit->RemoveAurasDueToSpell(m_spellInfo->Id);
|
||||
unit->RemoveAurasByCasterSpell(m_spellInfo->Id,m_caster->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
m_caster->RemoveAurasDueToSpell(m_spellInfo->Id);
|
||||
SendChannelUpdate(0);
|
||||
SendInterrupted(0);
|
||||
SendCastResult(SPELL_FAILED_INTERRUPTED);
|
||||
|
|
@ -3441,6 +3440,13 @@ void Spell::SendChannelUpdate(uint32 time)
|
|||
{
|
||||
if(time == 0)
|
||||
{
|
||||
m_caster->RemoveAurasByCasterSpell(m_spellInfo->Id,m_caster->GetGUID());
|
||||
|
||||
if(uint64 target_guid = m_caster->GetChannelObjectGUID())
|
||||
if(target_guid != m_caster->GetGUID() && IS_UNIT_GUID(target_guid))
|
||||
if(Unit* target = ObjectAccessor::GetUnit(*m_caster, target_guid))
|
||||
target->RemoveAurasByCasterSpell(m_spellInfo->Id,m_caster->GetGUID());
|
||||
|
||||
m_caster->SetChannelObjectGUID(0);
|
||||
m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue