aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/SpellHandler.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-02-14 23:11:38 -0300
committerShauren <shauren.trinity@gmail.com>2021-06-21 00:06:41 +0200
commit16b1f5c7f6324dcd5ac5803cae343359c5ba8611 (patch)
tree33126006634b66a0794046b2d5457a70641e9c28 /src/server/game/Handlers/SpellHandler.cpp
parent5323a7d38697967c12abe9b2903b97e271a2cac1 (diff)
Core/Handlers: fix bogus check that skipped CMSG_CAST_SPELL packet under certain conditions, missing a target change
Closes #21390 (cherry picked from commit a145a14166d12cd14a0018171fd4dd818b3a2fe5)
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 272905b22f7..48fb3685060 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -306,12 +306,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPackets::Spells::CastSpell& cast)
// Check possible spell cast overrides
spellInfo = caster->GetCastSpellInfo(spellInfo);
- // Client is resending autoshot cast opcode when other spell is cast during shoot rotation
- // Skip it to prevent "interrupt" message
- if (spellInfo->IsAutoRepeatRangedSpell() && caster->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)
- && caster->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)->m_spellInfo == spellInfo)
- return;
-
// can't use our own spells when we're in possession of another unit,
if (_player->isPossessing())
return;
@@ -319,6 +313,14 @@ void WorldSession::HandleCastSpellOpcode(WorldPackets::Spells::CastSpell& cast)
// client provided targets
SpellCastTargets targets(caster, cast.Cast);
+ // Client is resending autoshot cast opcode when other spell is cast during shoot rotation
+ // Skip it to prevent "interrupt" message
+ // Also check targets! target may have changed and we need to interrupt current spell
+ if (spellInfo->IsAutoRepeatRangedSpell())
+ if (Spell* spell = caster->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL))
+ if (spell->m_spellInfo == spellInfo && spell->m_targets.GetUnitTargetGUID() == targets.GetUnitTargetGUID())
+ return;
+
// auto-selection buff level base at target level (in spellInfo)
if (targets.GetUnitTarget())
{