From d8479debbbabe0aee1dedf589c6246e49ef3ad22 Mon Sep 17 00:00:00 2001 From: Laise Date: Wed, 2 Jun 2010 19:29:20 +0300 Subject: [PATCH] [10023] Change HandleLearnAllMySpellsCommand to learn only player's spells --- src/game/Level3.cpp | 10 +++++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 1df230f2d..6ed7809e3 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -1832,9 +1832,13 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/) return true; uint32 family = clsEntry->spellfamily; - for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) + for (uint32 i = 0; i < sSkillLineAbilityStore.GetNumRows(); ++i) { - SpellEntry const *spellInfo = sSpellStore.LookupEntry(i); + SkillLineAbilityEntry const *entry = sSkillLineAbilityStore.LookupEntry(i); + if (!entry) + continue; + + SpellEntry const *spellInfo = sSpellStore.LookupEntry(entry->spellId); if(!spellInfo) continue; @@ -1859,7 +1863,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/) if(!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false)) continue; - m_session->GetPlayer()->learnSpell(i, false); + m_session->GetPlayer()->learnSpell(spellInfo->Id, false); } SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 044bb38ad..74b5e1649 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 "10022" + #define REVISION_NR "10023" #endif // __REVISION_NR_H__