aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-09-02 15:12:28 +0200
committerShauren <shauren.trinity@gmail.com>2022-09-02 15:12:28 +0200
commitb08a58dec6511b757fea7d9fb3a1a178d56d8bba (patch)
tree0cf1046623f6836d3151afdda33388f523e75eea
parent0de520ed9241e6a6e449a6c9c00194e81b105201 (diff)
Core/Misc: Reduce differences between branches (refactors from 44ac5cbbea4f8e17be978412681634130f006d16)
-rw-r--r--src/server/game/Spells/SpellMgr.cpp13
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp14
2 files changed, 10 insertions, 17 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 5eb160086c2..00f92b8359e 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2105,15 +2105,12 @@ void SpellMgr::LoadPetLevelupSpellMap()
if (!creatureFamily->SkillLine[j])
continue;
- for (uint32 k = 0; k < sSkillLineAbilityStore.GetNumRows(); ++k)
- {
- SkillLineAbilityEntry const* skillLine = sSkillLineAbilityStore.LookupEntry(k);
- if (!skillLine)
- continue;
-
- if (skillLine->SkillLine != creatureFamily->SkillLine[j])
- continue;
+ std::vector<SkillLineAbilityEntry const*> const* skillLineAbilities = sDB2Manager.GetSkillLineAbilitiesBySkill(creatureFamily->SkillLine[j]);
+ if (!skillLineAbilities)
+ continue;
+ for (SkillLineAbilityEntry const* skillLine : *skillLineAbilities)
+ {
if (skillLine->AcquireMethod != SKILL_LINE_ABILITY_LEARNED_ON_SKILL_LEARN)
continue;
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index deba00eac0d..d06cce75a78 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -423,16 +423,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 != int32(skillId))
- continue;
+ std::vector<SkillLineAbilityEntry const*> const* skillLineAbilities = sDB2Manager.GetSkillLineAbilitiesBySkill(skillId);
+ if (!skillLineAbilities)
+ return;
+ for (SkillLineAbilityEntry const* skillLine : *skillLineAbilities)
+ {
// not high rank
if (skillLine->SupercedesSpell)
continue;