[11303] Fix crash in HandleTrainerBuySpellOpcode

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
Lynx3d 2011-04-01 10:07:07 +02:00 committed by NoFantasy
parent f9fb902f86
commit 0f3f282e9a
2 changed files with 6 additions and 3 deletions

View file

@ -248,11 +248,14 @@ void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data )
if (!cSpells && !tSpells)
return;
// not found, cheat?
TrainerSpell const* trainer_spell = cSpells->Find(spellId);
// Try find spell in npc_trainer
TrainerSpell const* trainer_spell = cSpells ? cSpells->Find(spellId) : NULL;
// Not found, try find in npc_trainer_template
if (!trainer_spell && tSpells)
trainer_spell = tSpells->Find(spellId);
// Not found anywhere, cheating?
if (!trainer_spell)
return;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11302"
#define REVISION_NR "11303"
#endif // __REVISION_NR_H__