From 44ac5cbbea4f8e17be978412681634130f006d16 Mon Sep 17 00:00:00 2001 From: ihm-tswow <76849026+ihm-tswow@users.noreply.github.com> Date: Fri, 2 Sep 2022 15:11:51 +0200 Subject: Core/Misc: Store skillline abilities grouped by skill id (#28199) --- src/server/scripts/Commands/cs_learn.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/server/scripts/Commands') 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 const* skillLineAbilities = GetSkillLineAbilitiesBySkill(skillId); + if (!skillLineAbilities) + return; + for (SkillLineAbilityEntry const* skillLine : *skillLineAbilities) + { // not high rank if (skillLine->SupercededBySpell) continue; -- cgit v1.2.3