From 98cc1342bee7bd658a8e01c6e9a41873f01a6bc5 Mon Sep 17 00:00:00 2001 From: sanctum32 Date: Sun, 17 Nov 2013 22:26:16 +0200 Subject: [PATCH] [12729] Fixed possible crash in LookupSpell command --- src/game/Level3.cpp | 6 ++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 42c15f3ff..a1f8734e4 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -3468,7 +3468,7 @@ bool ChatHandler::HandleLookupSpellCommand(char* args) uint32 counter = 0; // Counter for figure out that we found smth. // Search in Spell.dbc - for (uint32 id = 0; id < sSpellStore.GetNumRows(); ++id) + for (uint32 id = 0; id < sSpellStore.GetNumRows(); id++) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(id); if (spellInfo) @@ -3498,7 +3498,9 @@ bool ChatHandler::HandleLookupSpellCommand(char* args) if (loc < MAX_LOCALE) { - ShowSpellListHelper(target, spellInfo, LocaleConstant(loc)); + if (target) + ShowSpellListHelper(target, spellInfo, LocaleConstant(loc)); + ++counter; } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 168583cf2..a3dbe4aac 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12728" + #define REVISION_NR "12729" #endif // __REVISION_NR_H__