[10023] Change HandleLearnAllMySpellsCommand to learn only player's spells

This commit is contained in:
Laise 2010-06-02 19:29:20 +03:00
parent 7ed98198a7
commit d8479debbb
2 changed files with 8 additions and 4 deletions

View file

@ -1832,9 +1832,13 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
return true; return true;
uint32 family = clsEntry->spellfamily; 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) if(!spellInfo)
continue; continue;
@ -1859,7 +1863,7 @@ bool ChatHandler::HandleLearnAllMySpellsCommand(const char* /*args*/)
if(!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false)) if(!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer(),false))
continue; continue;
m_session->GetPlayer()->learnSpell(i, false); m_session->GetPlayer()->learnSpell(spellInfo->Id, false);
} }
SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS); SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10022" #define REVISION_NR "10023"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__