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:
blinkysc
2026-02-28 08:15:51 -06:00
committed by GitHub
parent 0912c11fc7
commit 6d93f67cdf
2 changed files with 9 additions and 0 deletions

View File

@@ -7459,6 +7459,10 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
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;
}
@@ -7505,7 +7509,11 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
}
if (HasSpellCooldown(spellInfo->Id))
{
Spell::SendCastResult(ToPlayer(), spellInfo, cast_count,
SPELL_FAILED_NOT_READY);
continue;
}
Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
spell->m_CastItem = item;

View File

@@ -509,6 +509,7 @@ public:
void SendPetCastResult(SpellCastResult result);
void SendSpellStart();
void SendSpellGo();
void SendSpellCooldown();
void SendLogExecute();
void ExecuteLogEffectTakeTargetPower(uint8 effIndex, Unit* target, uint32 PowerType, uint32 powerTaken, float gainMultiplier);