aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
authorclick <none@none>2010-04-26 17:27:33 +0200
committerclick <none@none>2010-04-26 17:27:33 +0200
commit4348e2bea22a9b9ca29011e08375bc2235dadfef (patch)
tree93d35f7ad11660461eb6d282ca3ed1ce97d532b5 /src/game/Player.cpp
parent71cdf91acc12bd10173b23718d3a3f3f66436bc9 (diff)
Properly relearn talents/spells when changing active specialization - also relearn the spells that require this talent
Fixes issue #907 - Patch by liberate --HG-- branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index b97a426187c..7b4c761bbb3 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -3438,7 +3438,7 @@ void Player::learnSpell(uint32 spell_id, bool dependent)
bool learning = addSpell(spell_id,active,true,dependent,false);
- // learn all disabled higher ranks (recursive)
+ // learn all disabled higher ranks and required spells (recursive)
if (disabled)
{
SpellChainNode const* node = spellmgr.GetSpellChainNode(spell_id);
@@ -3448,6 +3448,14 @@ void Player::learnSpell(uint32 spell_id, bool dependent)
if (iter != m_spells.end() && iter->second->disabled)
learnSpell(node->next, false);
}
+
+ SpellsRequiringSpellMapBounds spellsRequiringSpell = spellmgr.GetSpellsRequiringSpellBounds(spell_id);
+ for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequiringSpell.first; itr2 != spellsRequiringSpell.second; ++itr2)
+ {
+ PlayerSpellMap::iterator iter2 = m_spells.find(itr2->second);
+ if (iter2 != m_spells.end() && iter2->second->disabled)
+ learnSpell(itr2->second, false);
+ }
}
// prevent duplicated entires in spell book, also not send if not in world (loading)
@@ -23355,6 +23363,7 @@ void Player::ActivateSpec(uint8 spec)
return;
_SaveActions();
+ _SaveSpells();
if (IsNonMeleeSpellCasted(false))
InterruptNonMeleeSpells(false);