mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-08 02:00:29 +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))
|
||||
{
|
||||
// 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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user