diff options
author | Liberate <tbaart@gmail.com> | 2010-05-21 23:11:40 +0200 |
---|---|---|
committer | Liberate <tbaart@gmail.com> | 2010-05-21 23:11:40 +0200 |
commit | af1aecc1f5311a9ba82c5dc9dfec5751a6bd2647 (patch) | |
tree | aa29ea077e7eafef896f122cb17d42a072669df7 | |
parent | 7c1a189bd39ea11bbb42c412b57fa7421286cf98 (diff) |
*Fix: Relearn higher rank spells when talenting in the first rank.
Yay for my first push!
Fixes issue 2144
--HG--
branch : trunk
-rw-r--r-- | src/game/Player.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 7385f8f97af..0b31ec67b1f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3489,6 +3489,8 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) if (itr == m_spells.end()) return; // already unleared + bool giveTalentPoints = disabled || !itr->second->disabled; + bool cur_active = itr->second->active; bool cur_dependent = itr->second->dependent; @@ -3518,7 +3520,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // free talent points uint32 talentCosts = GetTalentSpellCost(spell_id); - if (talentCosts > 0) + if (talentCosts > 0 && giveTalentPoints) { if (talentCosts < m_usedTalentCount) m_usedTalentCount -= talentCosts; @@ -3884,11 +3886,11 @@ bool Player::resetTalents(bool no_cost) // skip non-existant talent ranks if (talentInfo->RankID[rank] == 0) continue; - removeSpell(talentInfo->RankID[rank]); + removeSpell(talentInfo->RankID[rank],true); if (const SpellEntry *_spellEntry = sSpellStore.LookupEntry(talentInfo->RankID[rank])) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellEntry for valid trigger spells if (_spellEntry->EffectTriggerSpell[i] > 0 && _spellEntry->Effect[i] == SPELL_EFFECT_LEARN_SPELL) - removeSpell(_spellEntry->EffectTriggerSpell[i]); // and remove any spells that the talent teaches + removeSpell(_spellEntry->EffectTriggerSpell[i],true); // and remove any spells that the talent teaches // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]); if (plrTalent != m_talents[m_activeSpec]->end()) |