mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[11303] Fix crash in HandleTrainerBuySpellOpcode
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
f9fb902f86
commit
0f3f282e9a
2 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11302"
|
||||
#define REVISION_NR "11303"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue