diff options
author | Ramusik <nikson.91@mail.ru> | 2011-04-11 13:26:28 +0300 |
---|---|---|
committer | Ramusik <nikson.91@mail.ru> | 2011-04-11 13:26:28 +0300 |
commit | 1c063696ace9c04bad3ad05df11dcaa472a997db (patch) | |
tree | 859d60c7f8da4383123a1432515dfe0e24e23ce5 /src | |
parent | 66081a3532a000c36ee8aee9878294a5d9674d40 (diff) |
Learn all my spells command should learn obly player's skills
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Commands/cs_learn.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp index d78da696987..0b45273d763 100644 --- a/src/server/scripts/Commands/cs_learn.cpp +++ b/src/server/scripts/Commands/cs_learn.cpp @@ -795,9 +795,13 @@ public: 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; @@ -822,7 +826,7 @@ public: if (!SpellMgr::IsSpellValid(spellInfo,handler->GetSession()->GetPlayer(),false)) continue; - handler->GetSession()->GetPlayer()->learnSpell(i, false); + handler->GetSession()->GetPlayer()->learnSpell(spellInfo->Id, false); } handler->SendSysMessage(LANG_COMMAND_LEARN_CLASS_SPELLS); |