Skip to content

Commit

Permalink
Spell: Add check for single target to resist/miss channeled spell cancel
Browse files Browse the repository at this point in the history
Closes  #645

I altered your PR a bit because:

Line with SPELL_MISS_IMMUNE2 should never be hit except for single target target. When spell is AOE, we do not supply unit target so check is redundant.
In second case, SPELL_MISS_RESIST - we want to just check if its the single target target. Like before, AOE does not supply that to the spell so its quicker.
The code is there for a spell like Mind Flay and nothing else really.
  • Loading branch information
obi23lipnik authored and killerwife committed Jan 10, 2024
1 parent 8e524e3 commit 32c3e15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4267,7 +4267,7 @@ void Spell::WriteSpellGoTargets(WorldPacket& data)
}
else
{
if (IsChanneledSpell(m_spellInfo) && (ihit.missCondition == SPELL_MISS_RESIST || ihit.missCondition == SPELL_MISS_REFLECT))
if (IsChanneledSpell(m_spellInfo) && (ihit.missCondition == SPELL_MISS_RESIST || ihit.missCondition == SPELL_MISS_REFLECT) && ihit.targetGUID == m_targets.getUnitTargetGuid())
{
m_duration = 0; // cancel aura to avoid visual effect continue
ihit.effectDuration = 0;
Expand Down

0 comments on commit 32c3e15

Please sign in to comment.