mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Core/Spells): Fix item use macro breaking melee auto-attack (#24926)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: QAston <QAston@users.noreply.github.com>
This commit is contained in:
@@ -7459,6 +7459,10 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
|
|||||||
|
|
||||||
if (HasSpellCooldown(spellInfo->Id))
|
if (HasSpellCooldown(spellInfo->Id))
|
||||||
{
|
{
|
||||||
|
// Notify client so it can clean up the pending spell cast.
|
||||||
|
// Without this the client orphans the cast and blocks auto-attack.
|
||||||
|
Spell::SendCastResult(ToPlayer(), spellInfo, cast_count,
|
||||||
|
SPELL_FAILED_NOT_READY);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7505,7 +7509,11 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (HasSpellCooldown(spellInfo->Id))
|
if (HasSpellCooldown(spellInfo->Id))
|
||||||
|
{
|
||||||
|
Spell::SendCastResult(ToPlayer(), spellInfo, cast_count,
|
||||||
|
SPELL_FAILED_NOT_READY);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
|
Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
|
||||||
spell->m_CastItem = item;
|
spell->m_CastItem = item;
|
||||||
|
|||||||
@@ -509,6 +509,7 @@ public:
|
|||||||
void SendPetCastResult(SpellCastResult result);
|
void SendPetCastResult(SpellCastResult result);
|
||||||
void SendSpellStart();
|
void SendSpellStart();
|
||||||
void SendSpellGo();
|
void SendSpellGo();
|
||||||
|
|
||||||
void SendSpellCooldown();
|
void SendSpellCooldown();
|
||||||
void SendLogExecute();
|
void SendLogExecute();
|
||||||
void ExecuteLogEffectTakeTargetPower(uint8 effIndex, Unit* target, uint32 PowerType, uint32 powerTaken, float gainMultiplier);
|
void ExecuteLogEffectTakeTargetPower(uint8 effIndex, Unit* target, uint32 PowerType, uint32 powerTaken, float gainMultiplier);
|
||||||
|
|||||||
Reference in New Issue
Block a user