Core/Handlers: fix bogus check that skipped CMSG_CAST_SPELL packet under certain conditions, missing a target change

This commit is contained in:
Aokromes committed 2018-02-16 03:30:18 +01:00
1 parent 66334459a6
commit 66a01f2d69
1 file changed
+15 -9
+15 -9
View File
@@ -403,15 +403,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
// 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)
{
recvPacket.rfinish();
return;
}
// can't use our own spells when we're in possession of another unit,
if (_player->isPossessing())
{
@@ -424,6 +415,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())
{