diff options
author | Intel <chemicstry@gmail.com> | 2014-11-16 02:42:00 +0200 |
---|---|---|
committer | Intel <chemicstry@gmail.com> | 2014-11-16 04:30:55 +0200 |
commit | 55c61599b25da18fdd16fc22168cc9a18ae56350 (patch) | |
tree | 2763bba70cbbdbd25caffb7c950104a77265016b /src | |
parent | d2ac05729a37d5e3aeb4500305e6cb9a26810369 (diff) |
Core/Talents: Fixed specialization spell learning and code style
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index c70317873be..ae8f0191137 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25478,14 +25478,20 @@ void Player::LearnTalentSpecialization(uint32 talentSpec) for (auto it = specSpells->second.begin(); it != specSpells->second.end(); ++it) { SpecializationSpellsEntry const* specSpell = *it; - if (HasSpell(specSpell->OverridesSpellID)) { + + // Unlearn spell if it is replaced by new specialization + if (specSpell->OverridesSpellID) RemoveSpell(specSpell->OverridesSpellID, true); - LearnSpell(specSpell->SpellID, false); - } + + // Learn new spell + if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(specSpell->SpellID)) + if (spellInfo->BaseLevel <= getLevel()) + LearnSpell(specSpell->SpellID, false); } } - if (CanUseMastery()) { + if (CanUseMastery()) + { ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(talentSpec); for (uint32 i = 0; i < MAX_MASTERY_SPELLS; ++i) if (SpellInfo const* masterySpell = sSpellMgr->GetSpellInfo(chrSpec->MasterySpellID[i])) |