mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
eee89851a6
commit
12426b158d
2 changed files with 3 additions and 30 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue