mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[9660] Simplify talents reset for pet case.
This commit is contained in:
parent
12426b158d
commit
ce40dedaf0
2 changed files with 3 additions and 23 deletions
|
|
@ -1595,28 +1595,8 @@ bool Pet::resetTalents(bool no_cost)
|
|||
continue;
|
||||
|
||||
for (int j = 0; j < MAX_TALENT_RANK; j++)
|
||||
{
|
||||
for(PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end();)
|
||||
{
|
||||
if(itr->second.state == PETSPELL_REMOVED)
|
||||
{
|
||||
++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] || sSpellMgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId))
|
||||
{
|
||||
removeSpell(itr->first,false);
|
||||
itr = m_spells.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