Skip to content

Commit

Permalink
[9660] Simplify talents reset for pet case.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirMangos committed Apr 2, 2010
1 parent 031c8fc commit dd1332b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
24 changes: 2 additions & 22 deletions src/game/Pet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9659"
#define REVISION_NR "9660"
#endif // __REVISION_NR_H__

0 comments on commit dd1332b

Please sign in to comment.