mirror of
https://github.com/araxiaonline/AscEmu.git
synced 2026-06-13 03:02:22 -04:00
Merge pull request #1107 from aaron02/fixprofessions
Fix Crash on Learning from Trainers
This commit is contained in:
@@ -139,12 +139,15 @@ void WorldSession::handleTrainerBuySpellOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
|
||||
TrainerSpell const* trainerSpell = nullptr;
|
||||
for (const auto& itr : sObjectMgr.getTrainserSpellSetById(trainer->spellset_id))
|
||||
std::vector<TrainerSpell>::const_iterator itr;
|
||||
std::vector<TrainerSpell> its = sObjectMgr.getTrainserSpellSetById(trainer->spellset_id);
|
||||
|
||||
for (itr = its.begin(); itr != its.end(); itr++)
|
||||
{
|
||||
if ((itr.castSpell && itr.castSpell->getId() == srlPacket.spellId) ||
|
||||
(itr.learnSpell && itr.learnSpell->getId() == srlPacket.spellId))
|
||||
if ((itr->castSpell && itr->castSpell->getId() == srlPacket.spellId) ||
|
||||
(itr->learnSpell && itr->learnSpell->getId() == srlPacket.spellId))
|
||||
{
|
||||
trainerSpell = &itr;
|
||||
trainerSpell = &(*itr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user