mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +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;
|
continue;
|
||||||
|
|
||||||
for (int j = 0; j < MAX_TALENT_RANK; j++)
|
for (int j = 0; j < MAX_TALENT_RANK; j++)
|
||||||
{
|
if (talentInfo->RankID[j])
|
||||||
for(PetSpellMap::const_iterator itr = m_spells.begin(); itr != m_spells.end();)
|
removeSpell(talentInfo->RankID[j],!IsPassiveSpell(talentInfo->RankID[j]),false);
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateFreeTalentPoints(false);
|
UpdateFreeTalentPoints(false);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9659"
|
#define REVISION_NR "9660"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue