mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Hunter): Fixed freeze while using Readiness. (#8709)
Fixes #8513
This commit is contained in:
@@ -786,25 +786,23 @@ public:
|
|||||||
Player* caster = GetCaster()->ToPlayer();
|
Player* caster = GetCaster()->ToPlayer();
|
||||||
// immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
|
// immediately finishes the cooldown on your other Hunter abilities except Bestial Wrath
|
||||||
|
|
||||||
PlayerSpellMap const& spellMap = caster->GetSpellMap();
|
// force removal of the disarm cooldown
|
||||||
for (PlayerSpellMap::const_iterator itr = spellMap.begin(); itr != spellMap.end(); ++itr)
|
caster->RemoveSpellCooldown(SPELL_HUNTER_CHIMERA_SHOT_SCORPID);
|
||||||
{
|
|
||||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
|
||||||
if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
|
|
||||||
spellInfo->Id != SPELL_HUNTER_READINESS &&
|
|
||||||
spellInfo->Id != SPELL_HUNTER_BESTIAL_WRATH &&
|
|
||||||
spellInfo->Id != SPELL_DRAENEI_GIFT_OF_THE_NAARU &&
|
|
||||||
spellInfo->GetRecoveryTime() > 0)
|
|
||||||
{
|
|
||||||
SpellCooldowns::iterator citr = caster->GetSpellCooldownMap().find(spellInfo->Id);
|
|
||||||
if (citr != caster->GetSpellCooldownMap().end() && citr->second.needSendToClient)
|
|
||||||
caster->RemoveSpellCooldown(spellInfo->Id, true);
|
|
||||||
else
|
|
||||||
caster->RemoveSpellCooldown(spellInfo->Id, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// force removal of the disarm cooldown
|
SpellCooldowns& cooldowns = caster->GetSpellCooldownMap();
|
||||||
caster->RemoveSpellCooldown(SPELL_HUNTER_CHIMERA_SHOT_SCORPID, false);
|
|
||||||
|
SpellCooldowns::iterator itr, next;
|
||||||
|
for (itr = cooldowns.begin(); itr != cooldowns.end(); itr = next)
|
||||||
|
{
|
||||||
|
next = itr;
|
||||||
|
++next;
|
||||||
|
|
||||||
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
||||||
|
if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && spellInfo->Id != SPELL_HUNTER_READINESS && spellInfo->Id != SPELL_HUNTER_BESTIAL_WRATH &&
|
||||||
|
spellInfo->Id != SPELL_DRAENEI_GIFT_OF_THE_NAARU && spellInfo->GetRecoveryTime() > 0)
|
||||||
|
{
|
||||||
|
caster->RemoveSpellCooldown(spellInfo->Id, itr->second.needSendToClient);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user