diff options
author | Matan Shukry <matanshukry@gmail.com> | 2021-02-24 21:20:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-24 20:20:14 +0100 |
commit | 9e948ff4bd5d2f584cde19d851bbbf1bb93b51d4 (patch) | |
tree | 5543571b372d5aceb375e9fd2a34a26f331a3055 /src | |
parent | 428fbcb133555b12f45cde64c6db4c1da5f766ea (diff) |
Core/Spells: Corrected the spell id source used in the learn spells map when loading SpellLearnSpell.db2 data (#26140)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7b92b7c4051..43ee4952ed3 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1087,16 +1087,17 @@ void SpellMgr::LoadSpellLearnSpells() for (SpellLearnSpellEntry const* spellLearnSpell : sSpellLearnSpellStore) { - if (!GetSpellInfo(spellLearnSpell->SpellID, DIFFICULTY_NONE)) + if (!GetSpellInfo(spellLearnSpell->SpellID, DIFFICULTY_NONE) || + !GetSpellInfo(spellLearnSpell->LearnSpellID, DIFFICULTY_NONE)) continue; - SpellLearnSpellMapBounds db_node_bounds = dbSpellLearnSpells.equal_range(spellLearnSpell->LearnSpellID); + SpellLearnSpellMapBounds db_node_bounds = dbSpellLearnSpells.equal_range(spellLearnSpell->SpellID); bool found = false; for (SpellLearnSpellMap::const_iterator itr = db_node_bounds.first; itr != db_node_bounds.second; ++itr) { - if (int32(itr->second.Spell) == spellLearnSpell->SpellID) + if (int32(itr->second.Spell) == spellLearnSpell->LearnSpellID) { - TC_LOG_ERROR("sql.sql", "Found redundant record (entry: %u, SpellID: %u) in `spell_learn_spell`, spell added automatically from SpellLearnSpell.db2", spellLearnSpell->LearnSpellID, spellLearnSpell->SpellID); + TC_LOG_ERROR("sql.sql", "Found redundant record (entry: %u, SpellID: %u) in `spell_learn_spell`, spell added automatically from SpellLearnSpell.db2", spellLearnSpell->SpellID, spellLearnSpell->LearnSpellID); found = true; break; } @@ -1106,11 +1107,11 @@ void SpellMgr::LoadSpellLearnSpells() continue; // Check if it is already found in Spell.dbc, ignore silently if yes - SpellLearnSpellMapBounds dbc_node_bounds = GetSpellLearnSpellMapBounds(spellLearnSpell->LearnSpellID); + SpellLearnSpellMapBounds dbc_node_bounds = GetSpellLearnSpellMapBounds(spellLearnSpell->SpellID); found = false; for (SpellLearnSpellMap::const_iterator itr = dbc_node_bounds.first; itr != dbc_node_bounds.second; ++itr) { - if (int32(itr->second.Spell) == spellLearnSpell->SpellID) + if (int32(itr->second.Spell) == spellLearnSpell->LearnSpellID) { found = true; break; @@ -1121,12 +1122,12 @@ void SpellMgr::LoadSpellLearnSpells() continue; SpellLearnSpellNode dbcLearnNode; - dbcLearnNode.Spell = spellLearnSpell->SpellID; + dbcLearnNode.Spell = spellLearnSpell->LearnSpellID; dbcLearnNode.OverridesSpell = spellLearnSpell->OverridesSpellID; dbcLearnNode.Active = true; dbcLearnNode.AutoLearned = false; - mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spellLearnSpell->LearnSpellID, dbcLearnNode)); + mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spellLearnSpell->SpellID, dbcLearnNode)); ++dbc_count; } |