aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorihm-tswow <76849026+ihm-tswow@users.noreply.github.com>2022-09-02 15:11:51 +0200
committerGitHub <noreply@github.com>2022-09-02 15:11:51 +0200
commit44ac5cbbea4f8e17be978412681634130f006d16 (patch)
treecf8baf68730073aa9337000869f9a478ecd21886 /src/server/scripts/Commands
parentd86dcce1c855c5d2d5b48c00ef0e929f87b8b36e (diff)
Core/Misc: Store skillline abilities grouped by skill id (#28199)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index 86e625f9d1b..57fe66a981f 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -435,16 +435,12 @@ public:
{
uint32 classmask = player->GetClassMask();
- for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
- {
- SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(j);
- if (!skillLine)
- continue;
-
- // wrong skill
- if (skillLine->SkillLine != skillId)
- continue;
+ std::vector<SkillLineAbilityEntry const*> const* skillLineAbilities = GetSkillLineAbilitiesBySkill(skillId);
+ if (!skillLineAbilities)
+ return;
+ for (SkillLineAbilityEntry const* skillLine : *skillLineAbilities)
+ {
// not high rank
if (skillLine->SupercededBySpell)
continue;