fix(Core/Spells): properly handle item cooldowns (#9176)

- Closes #8918
This commit is contained in:
UltraNix 2021-11-23 13:25:29 +01:00 committed by GitHub
parent 05552d9d85
commit a0002afe07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)