Core/Handlers: fix bogus check that skipped CMSG_CAST_SPELL packet under certain conditions, missing a target change
Port From (https://github.com/TrinityCore/TrinityCore/commit/16b1f5c7f6324dcd5ac5803cae343359c5ba8611)
This commit is contained in:
@@ -304,12 +304,6 @@ namespace Game
|
|||||||
// Check possible spell cast overrides
|
// Check possible spell cast overrides
|
||||||
spellInfo = caster.GetCastSpellInfo(spellInfo);
|
spellInfo = caster.GetCastSpellInfo(spellInfo);
|
||||||
|
|
||||||
// Client is resending autoshot cast opcode when other spell is casted during shoot rotation
|
|
||||||
// Skip it to prevent "interrupt" message
|
|
||||||
if (spellInfo.IsAutoRepeatRangedSpell() && GetPlayer().GetCurrentSpell(CurrentSpellTypes.AutoRepeat) != null
|
|
||||||
&& GetPlayer().GetCurrentSpell(CurrentSpellTypes.AutoRepeat).m_spellInfo == spellInfo)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// can't use our own spells when we're in possession of another unit,
|
// can't use our own spells when we're in possession of another unit,
|
||||||
if (GetPlayer().IsPossessing())
|
if (GetPlayer().IsPossessing())
|
||||||
return;
|
return;
|
||||||
@@ -317,6 +311,17 @@ namespace Game
|
|||||||
// client provided targets
|
// client provided targets
|
||||||
SpellCastTargets targets = new(caster, cast.Cast);
|
SpellCastTargets targets = new(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())
|
||||||
|
{
|
||||||
|
Spell autoRepeatSpell = caster.GetCurrentSpell(CurrentSpellTypes.AutoRepeat);
|
||||||
|
if (autoRepeatSpell != null)
|
||||||
|
if (autoRepeatSpell.m_spellInfo == spellInfo && autoRepeatSpell.m_targets.GetUnitTargetGUID() == targets.GetUnitTargetGUID())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// auto-selection buff level base at target level (in spellInfo)
|
// auto-selection buff level base at target level (in spellInfo)
|
||||||
if (targets.GetUnitTarget() != null)
|
if (targets.GetUnitTarget() != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user