aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index a34836ad42a..40dcbd90c10 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3487,13 +3487,9 @@ void SpellMgr::LoadPetFamilySpellsStore()
if (!levels->DifficultyID)
levelsBySpell[levels->SpellID] = levels;
- for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
+ for (SkillLineAbilityEntry const* skillLine : sSkillLineAbilityStore)
{
- SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j);
- if (!skillLine)
- continue;
-
- SpellEntry const* spellInfo = sSpellStore.LookupEntry(skillLine->SpellID);
+ SpellInfo const* spellInfo = GetSpellInfo(skillLine->SpellID);
if (!spellInfo)
continue;
@@ -3501,24 +3497,17 @@ void SpellMgr::LoadPetFamilySpellsStore()
if (levels != levelsBySpell.end() && levels->second->SpellLevel)
continue;
- if (SpellMiscEntry const* spellMisc = sSpellMiscStore.LookupEntry(spellInfo->MiscID))
+ if (spellInfo->IsPassive())
{
- if (spellMisc->Attributes & SPELL_ATTR0_PASSIVE)
+ for (CreatureFamilyEntry const* cFamily : sCreatureFamilyStore)
{
- for (uint32 i = 1; i < sCreatureFamilyStore.GetNumRows(); ++i)
- {
- CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(i);
- if (!cFamily)
- continue;
-
- if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1])
- continue;
+ if (skillLine->SkillLine != cFamily->SkillLine[0] && skillLine->SkillLine != cFamily->SkillLine[1])
+ continue;
- if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
- continue;
+ if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
+ continue;
- sPetFamilySpellsStore[i].insert(spellInfo->ID);
- }
+ sPetFamilySpellsStore[cFamily->ID].insert(spellInfo->Id);
}
}
}