[9659] Simplify resetTalent code.

Currently all code related to deepndent spells unlern exist in removeSpell
so not need do it in special way in talentReset.
This commit is contained in:
VladimirMangos 2010-04-02 23:09:17 +04:00
parent eee89851a6
commit 12426b158d
2 changed files with 3 additions and 30 deletions

View file

@ -3659,35 +3659,8 @@ bool Player::resetTalents(bool no_cost)
continue;
for (int j = 0; j < MAX_TALENT_RANK; ++j)
{
for(PlayerSpellMap::iterator itr = GetSpellMap().begin(); itr != GetSpellMap().end();)
{
if (itr->second.state == PLAYERSPELL_REMOVED || itr->second.disabled)
{
++itr;
continue;
}
// remove learned spells (all ranks)
uint32 itrFirstId = sSpellMgr.GetFirstSpellInChain(itr->first);
// unlearn if first rank is talent or learned by talent
if (itrFirstId == talentInfo->RankID[j])
{
removeSpell(itr->first,!IsPassiveSpell(itr->first),false);
itr = GetSpellMap().begin();
continue;
}
else if (sSpellMgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
{
removeSpell(itr->first,!IsPassiveSpell(itr->first));
itr = GetSpellMap().begin();
continue;
}
else
++itr;
}
}
if (talentInfo->RankID[j])
removeSpell(talentInfo->RankID[j],!IsPassiveSpell(talentInfo->RankID[j]),false);
}
UpdateFreeTalentPoints(false);