aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximius <none@none>2009-11-21 06:24:15 -0800
committermaximius <none@none>2009-11-21 06:24:15 -0800
commit7a2cad6e1b552d71572c1d2bf36444288438245d (patch)
treea5608f407aacb76405d8d5e0b5e8b1094242fcbc
parente73ab432eb386dedb1e22b56d124c9ef7da46da6 (diff)
*Fix a crash :(
--HG-- branch : trunk
-rw-r--r--src/game/Player.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index f0a16279b7b..a47f2fd9786 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -3804,19 +3804,13 @@ bool Player::resetTalents(bool no_cost)
// unlearn if first rank is talent or learned by talent
if (itrFirstId == talentInfo->RankID[rank])
{
- itr->second->state = PLAYERSPELL_NEW;
- removeSpell(itr->first, false, false);
- itr->second->disabled = true;
- itr->second->state = PLAYERSPELL_REMOVED;
+ removeSpell(itr->first, true, false);
itr = GetSpellMap().begin();
continue;
}
else if (spellmgr.IsSpellLearnToSpell(talentInfo->RankID[rank], itrFirstId))
{
- itr->second->state = PLAYERSPELL_NEW;
- removeSpell(itr->first, false, true);
- itr->second->disabled = true;
- itr->second->state = PLAYERSPELL_REMOVED;
+ removeSpell(itr->first, true, true);
itr = GetSpellMap().begin();
continue;
}
@@ -3829,6 +3823,8 @@ bool Player::resetTalents(bool no_cost)
}
}
+ _SaveSpells();
+
SetFreeTalentPoints(talentPointsForLevel);
if (!no_cost)
@@ -22031,18 +22027,13 @@ void Player::ActivateSpec(uint8 spec)
// unlearn if first rank is talent or learned by talent
if (itrFirstId == talentInfo->RankID[rank])
{
- itr->second->state = PLAYERSPELL_NEW;
- removeSpell(itr->first, false, false);
- itr->second->disabled = true;
- itr->second->state = PLAYERSPELL_REMOVED;
+ removeSpell(itr->first, true, false);
+ itr = GetSpellMap().begin();
continue;
}
else if (spellmgr.IsSpellLearnToSpell(talentInfo->RankID[rank], itrFirstId))
{
- itr->second->state = PLAYERSPELL_NEW;
- removeSpell(itr->first, false, true);
- itr->second->disabled = true;
- itr->second->state = PLAYERSPELL_REMOVED;
+ removeSpell(itr->first, true, true);
itr = GetSpellMap().begin();
continue;
}
@@ -22107,6 +22098,8 @@ void Player::ActivateSpec(uint8 spec)
m_usedTalentCount = spentTalents;
InitTalentForLevel();
+ _SaveSpells();
+
m_actionButtons.clear();
if (QueryResult *result = CharacterDatabase.PQuery("SELECT button,action,type FROM character_action WHERE guid = '%u' AND spec = '%u' ORDER BY button", GetGUIDLow(), m_activeSpec))
_LoadActions(result, false);