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:
Anton Popovichenko
2024-04-01 10:50:12 +02:00
committed by GitHub
parent aee2eefb92
commit 47f9d66874
5 changed files with 24 additions and 32 deletions

View File

@@ -2323,19 +2323,8 @@ void SpellMgr::LoadPetLevelupSpellMap()
if (!creatureFamily->skillLine[j])
continue;
for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k)
for (SkillLineAbilityEntry const* skillLine : GetSkillLineAbilitiesBySkillLine(creatureFamily->skillLine[j]))
{
SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(k);
if (!skillLine)
continue;
//if (skillLine->skillId != creatureFamily->skillLine[0] &&
// (!creatureFamily->skillLine[1] || skillLine->skillId != creatureFamily->skillLine[1]))
// continue;
if (skillLine->SkillLine != creatureFamily->skillLine[j])
continue;
if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;