mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core/Optimization): Create index for sSkillLineAbilityStore to speedup search by skillLine. (#18622)
* feat(Core/Optimization): Create index for sSkillLineAbilityStore to speedup search by skillLine. * Remove whitespace.
This commit is contained in:
committed by
GitHub
parent
aee2eefb92
commit
47f9d66874
@@ -5313,10 +5313,8 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
|
||||
mSkillStatus.erase(itr);
|
||||
|
||||
// remove all spells that related to this skill
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j))
|
||||
if (pAbility->SkillLine == id)
|
||||
removeSpell(sSpellMgr->GetFirstSpellInChain(pAbility->Spell), SPEC_MASK_ALL, false);
|
||||
for (SkillLineAbilityEntry const* pAbility : GetSkillLineAbilitiesBySkillLine(id))
|
||||
removeSpell(sSpellMgr->GetFirstSpellInChain(pAbility->Spell), SPEC_MASK_ALL, false);
|
||||
}
|
||||
}
|
||||
else if (newVal) //add
|
||||
@@ -11935,14 +11933,8 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value)
|
||||
{
|
||||
uint32 raceMask = getRaceMask();
|
||||
uint32 classMask = getClassMask();
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
for (SkillLineAbilityEntry const* pAbility : GetSkillLineAbilitiesBySkillLine(skill_id))
|
||||
{
|
||||
SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j);
|
||||
if (!pAbility || pAbility->SkillLine != skill_id)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pAbility->Spell);
|
||||
if (!spellInfo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user