aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r--src/game/ObjectMgr.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index b7dafe9a55a..dae60a230f1 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -7100,36 +7100,34 @@ void ObjectMgr::LoadTrainerSpell()
continue;
}
- TrainerSpell* pTrainerSpell = new TrainerSpell();
- pTrainerSpell->spell = spell;
- pTrainerSpell->spellCost = fields[2].GetUInt32();
- pTrainerSpell->reqSkill = fields[3].GetUInt32();
- pTrainerSpell->reqSkillValue = fields[4].GetUInt32();
- pTrainerSpell->reqLevel = fields[5].GetUInt32();
+ TrainerSpellData& data = m_mCacheTrainerSpellMap[entry];
+
+ if(SpellMgr::IsProfessionSpell(spell))
+ data.trainerType = 2;
+
+ TrainerSpell& trainerSpell = data.spellList[spell];
+ trainerSpell.spell = spell;
+ trainerSpell.spellCost = fields[2].GetUInt32();
+ trainerSpell.reqSkill = fields[3].GetUInt32();
+ trainerSpell.reqSkillValue = fields[4].GetUInt32();
+ trainerSpell.reqLevel = fields[5].GetUInt32();
- if(!pTrainerSpell->reqLevel)
- pTrainerSpell->reqLevel = spellinfo->spellLevel;
+ if(!trainerSpell.reqLevel)
+ trainerSpell.reqLevel = spellinfo->spellLevel;
// calculate learned spell for profession case when stored cast-spell
- pTrainerSpell->learnedSpell = spell;
+ trainerSpell.learnedSpell = spell;
for(int i = 0; i <3; ++i)
{
- if(spellinfo->Effect[i]!=SPELL_EFFECT_LEARN_SPELL)
+ if(spellinfo->Effect[i] != SPELL_EFFECT_LEARN_SPELL)
continue;
-
if(SpellMgr::IsProfessionOrRidingSpell(spellinfo->EffectTriggerSpell[i]))
{
- pTrainerSpell->learnedSpell = spellinfo->EffectTriggerSpell[i];
+ trainerSpell.learnedSpell = spellinfo->EffectTriggerSpell[i];
break;
}
}
- TrainerSpellData& data = m_mCacheTrainerSpellMap[entry];
-
- if(SpellMgr::IsProfessionSpell(spell))
- data.trainerType = 2;
-
- data.spellList.push_back(pTrainerSpell);
++count;
} while (result->NextRow());