[9660] Simplify talents reset for pet case.

This commit is contained in:
VladimirMangos 2010-04-02 23:20:10 +04:00
parent 12426b158d
commit ce40dedaf0
2 changed files with 3 additions and 23 deletions

View file

@ -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);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9659"
#define REVISION_NR "9660"
#endif // __REVISION_NR_H__