mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Core/Spells): several improvements to cooldowns (#7559)
- Reworked spell category cooldowns. - Implemented category cooldowns for pets. - Properly shows pet spell cooldowns in player's UI. - Corrected pet spell cooldowns with infinity duration. - Do not add/remove infinity spell cooldown on aura apply/remove if casted by item. - Closes #5263
This commit is contained in:
@@ -2913,15 +2913,13 @@ void ObjectMgr::LoadItemTemplates()
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
if (itemTemplate.Spells[i].SpellId && itemTemplate.Spells[i].SpellCategory && itemTemplate.Spells[i].SpellCategoryCooldown)
|
||||
{
|
||||
SpellCategoryStore::const_iterator ct = sSpellsByCategoryStore.find(itemTemplate.Spells[i].SpellCategory);
|
||||
SpellCategoryStore::iterator ct = sSpellsByCategoryStore.find(itemTemplate.Spells[i].SpellCategory);
|
||||
if (ct != sSpellsByCategoryStore.end())
|
||||
{
|
||||
const SpellCategorySet& ct_set = ct->second;
|
||||
if (ct_set.find(itemTemplate.Spells[i].SpellId) == ct_set.end())
|
||||
sSpellsByCategoryStore[itemTemplate.Spells[i].SpellCategory].insert(itemTemplate.Spells[i].SpellId);
|
||||
ct->second.emplace(true, itemTemplate.Spells[i].SpellId);
|
||||
}
|
||||
else
|
||||
sSpellsByCategoryStore[itemTemplate.Spells[i].SpellCategory].insert(itemTemplate.Spells[i].SpellId);
|
||||
sSpellsByCategoryStore[itemTemplate.Spells[i].SpellCategory].emplace(true, itemTemplate.Spells[i].SpellId);
|
||||
}
|
||||
|
||||
++count;
|
||||
|
||||
Reference in New Issue
Block a user