[7283] Use map for trainer spells for fast find data by spell id.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
zhenya 2009-02-15 22:47:47 +03:00 committed by VladimirMangos
parent 02b4b2f0b1
commit 22656b33e3
5 changed files with 38 additions and 42 deletions

View file

@ -160,9 +160,9 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
float fDiscountMod = _player->GetReputationPriceDiscount(unit);
uint32 count = 0;
for(TrainerSpellList::const_iterator itr = trainer_spells->spellList.begin(); itr != trainer_spells->spellList.end(); ++itr)
for(TrainerSpellMap::const_iterator itr = trainer_spells->spellList.begin(); itr != trainer_spells->spellList.end(); ++itr)
{
TrainerSpell const* tSpell = *itr;
TrainerSpell const* tSpell = &itr->second;
if(!_player->IsSpellFitByClassAndRace(tSpell->learnedSpell))
continue;