mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Core/Spells): properly handle item cooldowns (#9176)
- Closes #8918
This commit is contained in:
@@ -10139,6 +10139,7 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
||||
// cooldown information stored in item prototype
|
||||
// This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
|
||||
|
||||
bool useSpellCooldown = false;
|
||||
if (itemId)
|
||||
{
|
||||
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemId))
|
||||
@@ -10150,6 +10151,12 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
||||
cat = proto->Spells[idx].SpellCategory;
|
||||
rec = proto->Spells[idx].SpellCooldown;
|
||||
catrec = proto->Spells[idx].SpellCategoryCooldown;
|
||||
|
||||
if (static_cast<int32>(cat) != catrec)
|
||||
{
|
||||
useSpellCooldown = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -10168,7 +10175,6 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
||||
time_t recTime;
|
||||
|
||||
bool needsCooldownPacket = false;
|
||||
bool useSpellCooldown = false;
|
||||
|
||||
// overwrite time for selected category
|
||||
if (infinityCooldown)
|
||||
|
||||
Reference in New Issue
Block a user