aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-02-14 23:11:38 -0300
committerariel- <ariel-@users.noreply.github.com>2018-02-14 23:11:38 -0300
commita145a14166d12cd14a0018171fd4dd818b3a2fe5 (patch)
treea0e474bf13d8937a6da56d3307fad1bb15be1d00 /src
parent93cbe815cb6dfc1cd7535db2cabf81d42bf60da7 (diff)
Core/Handlers: fix bogus check that skipped CMSG_CAST_SPELL packet under certain conditions, missing a target change
Closes #21390
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 1bee88ee2ee..cf427c2e88e 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -376,15 +376,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
return;
}
- // 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)
- {
- recvPacket.rfinish();
- return;
- }
-
// can't use our own spells when we're in possession of another unit,
if (_player->isPossessing())
{
@@ -397,6 +388,21 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
targets.Read(recvPacket, caster);
HandleClientCastFlags(recvPacket, castFlags, targets);
+ // 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())
+ {
+ recvPacket.rfinish();
+ return;
+ }
+ }
+ }
+
// auto-selection buff level base at target level (in spellInfo)
if (targets.GetUnitTarget())
{