aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-21 07:32:09 -0800
committermaximius <none@none>2009-11-21 07:32:09 -0800
commit729bc6d68fb50976e02ee910c56d8870499f1096 (patch)
tree33cc6109c4a21fa22f2bf64eca652c71a7471df8
parentea6a32267061db967fd183231aa90caf31d1ea6e (diff)
*Ignore whether or not a spell is in the active spec on spec swap (it doesn't matter, the spells from your other spec will be learned shortly)
*Ignore whether or not a spell is in the active or inactive spec on talent reset (it doesn't matter, the spells from your other spec can be learned with a simple spec swap) --HG-- branch : trunk
-rw-r--r--src/game/Player.cpp48
1 files changed, 21 insertions, 27 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 58d515ba014..83aefa50710 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -3794,22 +3794,19 @@ bool Player::resetTalents(bool no_cost)
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]);
- if (plrTalent != m_talents[m_activeSpec]->end() || m_talents[m_activeSpec]->empty())
+ for (PlayerSpellMap::iterator itr = GetSpellMap().begin(); itr != GetSpellMap().end(); ++itr)
{
- for (PlayerSpellMap::iterator itr = GetSpellMap().begin(); itr != GetSpellMap().end(); ++itr)
- {
- // remove learned spells (all ranks)
- uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first);
+ // remove learned spells (all ranks)
+ uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first);
- // unlearn if first rank is talent or learned by talent
- if (itrFirstId == talentInfo->RankID[rank])
- removeSpell(itr->first, true, false);
- else if (spellmgr.IsSpellLearnToSpell(talentInfo->RankID[rank], itrFirstId))
- removeSpell(itr->first, true, true);
- }
- if (!m_talents[m_activeSpec]->empty())
- plrTalent->second->state = PLAYERSPELL_REMOVED; // mark the talent in the talent map as removed
+ // unlearn if first rank is talent or learned by talent
+ if (itrFirstId == talentInfo->RankID[rank])
+ removeSpell(itr->first, true, false);
+ else if (spellmgr.IsSpellLearnToSpell(talentInfo->RankID[rank], itrFirstId))
+ removeSpell(itr->first, true, true);
}
+ if (plrTalent != m_talents[m_activeSpec]->end())
+ plrTalent->second->state = PLAYERSPELL_REMOVED; // mark the talent in the talent map as removed
}
}
@@ -22006,22 +22003,19 @@ void Player::ActivateSpec(uint8 spec)
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
{
- PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]);
- if (plrTalent != m_talents[m_activeSpec]->end() || m_talents[m_activeSpec]->empty())
+ //PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]);
+ for (PlayerSpellMap::iterator itr = GetSpellMap().begin(); itr != GetSpellMap().end(); ++itr)
{
- for (PlayerSpellMap::iterator itr = GetSpellMap().begin(); itr != GetSpellMap().end(); ++itr)
- {
- // remove learned spells (all ranks)
- uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first);
-
- // unlearn if first rank is talent or learned by talent
- if (itrFirstId == talentInfo->RankID[rank])
- removeSpell(itr->first, true, false);
- else if (spellmgr.IsSpellLearnToSpell(talentInfo->RankID[rank], itrFirstId))
- removeSpell(itr->first, true, true);
- }
- //plrTalent->second->state = PLAYERSPELL_REMOVED; // mark the talent in the talent map as removed
+ // remove learned spells (all ranks)
+ uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first);
+
+ // unlearn if first rank is talent or learned by talent
+ if (itrFirstId == talentInfo->RankID[rank])
+ removeSpell(itr->first, true, false);
+ else if (spellmgr.IsSpellLearnToSpell(talentInfo->RankID[rank], itrFirstId))
+ removeSpell(itr->first, true, true);
}
+ //plrTalent->second->state = PLAYERSPELL_REMOVED; // mark the talent in the talent map as removed
}
}
}