aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellMgr.cpp')
-rw-r--r--src/game/SpellMgr.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 4d5a9775d98..c7bf8cd5bac 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1953,6 +1953,8 @@ void SpellMgr::LoadPetLevelupSpellMap()
mPetLevelupSpellMap.clear(); // need for reload case
uint32 count = 0;
+ uint32 family_count = 0;
+
for (uint32 i = 0; i < sCreatureFamilyStore.GetNumRows(); ++i)
{
CreatureFamilyEntry const *creatureFamily = sCreatureFamilyStore.LookupEntry(i);
@@ -1977,17 +1979,24 @@ void SpellMgr::LoadPetLevelupSpellMap()
continue;
SpellEntry const *spell = sSpellStore.LookupEntry(skillLine->spellId);
- // not exist or triggered or talent
- if(!spell || !spell->spellLevel)
+ if(!spell) // not exist or triggered or talent
+ continue;
+
+ if(!spell->spellLevel)
continue;
- mPetLevelupSpellMap.insert(PetLevelupSpellMap::value_type(creatureFamily->ID, std::make_pair(spell->spellLevel , spell->Id )));
+
+ PetLevelupSpellSet& spellSet = mPetLevelupSpellMap[creatureFamily->ID];
+ if(spellSet.empty())
+ ++family_count;
+
+ spellSet.insert(PetLevelupSpellSet::value_type(spell->spellLevel,spell->Id));
count++;
}
}
}
sLog.outString();
- sLog.outString( ">> Loaded %u pet levelup spells", count );
+ sLog.outString( ">> Loaded %u pet levelup and default spells for %u families", count, family_count );
}
/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc