mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +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
|
// cooldown information stored in item prototype
|
||||||
// This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
|
// This used in same way in WorldSession::HandleItemQuerySingleOpcode data sending to client.
|
||||||
|
|
||||||
|
bool useSpellCooldown = false;
|
||||||
if (itemId)
|
if (itemId)
|
||||||
{
|
{
|
||||||
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(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;
|
cat = proto->Spells[idx].SpellCategory;
|
||||||
rec = proto->Spells[idx].SpellCooldown;
|
rec = proto->Spells[idx].SpellCooldown;
|
||||||
catrec = proto->Spells[idx].SpellCategoryCooldown;
|
catrec = proto->Spells[idx].SpellCategoryCooldown;
|
||||||
|
|
||||||
|
if (static_cast<int32>(cat) != catrec)
|
||||||
|
{
|
||||||
|
useSpellCooldown = true;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10168,7 +10175,6 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
|
|||||||
time_t recTime;
|
time_t recTime;
|
||||||
|
|
||||||
bool needsCooldownPacket = false;
|
bool needsCooldownPacket = false;
|
||||||
bool useSpellCooldown = false;
|
|
||||||
|
|
||||||
// overwrite time for selected category
|
// overwrite time for selected category
|
||||||
if (infinityCooldown)
|
if (infinityCooldown)
|
||||||
|
|||||||
Reference in New Issue
Block a user