fix(Core/Spells): category cooldowns (#6191)

- Closes #5475
- Closes https://github.com/chromiecraft/chromiecraft/issues/466
This commit is contained in:
UltraNix 2021-06-12 19:51:47 +02:00 committed by GitHub
parent ad806b3aa6
commit dafef5bd78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23094,6 +23094,13 @@ void Player::AddSpellAndCategoryCooldowns(SpellInfo const* spellInfo, uint32 ite
if (*i_scset == spellInfo->Id) // skip main spell, already handled above
continue;
// Only within the same spellfamily
SpellInfo const* categorySpellInfo = sSpellMgr->GetSpellInfo(*i_scset);
if (!categorySpellInfo || categorySpellInfo->SpellFamilyName != spellInfo->SpellFamilyName)
{
continue;
}
AddSpellCooldown(*i_scset, itemId, catrecTime, !spellInfo->IsCooldownStartedOnEvent() && spellInfo->CategoryRecoveryTime != spellInfo->RecoveryTime && spellInfo->RecoveryTime && spellInfo->CategoryRecoveryTime); // Xinef: send category cooldowns on login if category cooldown is different from base cooldown
}
}