mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[9694] Not crash in case unknown spell expected to be learned at spec switch.
It will output error insteed and continue.
This commit is contained in:
parent
93bc46b1f3
commit
45fba95d13
2 changed files with 19 additions and 4 deletions
|
|
@ -21733,20 +21733,35 @@ void Player::ActivateSpec(uint8 specNum)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 talentSpellId = talent.m_talentEntry->RankID[talent.currentRank];
|
||||||
|
|
||||||
// learn talent spells if they not in new spec (old spec copy)
|
// learn talent spells if they not in new spec (old spec copy)
|
||||||
// and if they have different rank
|
// and if they have different rank
|
||||||
PlayerTalentMap::iterator specIter = m_talents[m_activeSpec].find(tempIter->first);
|
PlayerTalentMap::iterator specIter = m_talents[m_activeSpec].find(tempIter->first);
|
||||||
if (specIter != m_talents[m_activeSpec].end() && specIter->second.state != PLAYERSPELL_REMOVED)
|
if (specIter != m_talents[m_activeSpec].end() && specIter->second.state != PLAYERSPELL_REMOVED)
|
||||||
{
|
{
|
||||||
if ((*specIter).second.currentRank != talent.currentRank)
|
if ((*specIter).second.currentRank != talent.currentRank)
|
||||||
learnSpell(talent.m_talentEntry->RankID[talent.currentRank], false);
|
learnSpell(talentSpellId, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
learnSpell(talent.m_talentEntry->RankID[talent.currentRank], false);
|
learnSpell(talentSpellId, false);
|
||||||
|
|
||||||
// sync states - original state is changed in addSpell that learnSpell calls
|
// sync states - original state is changed in addSpell that learnSpell calls
|
||||||
specIter = m_talents[m_activeSpec].find(tempIter->first);
|
specIter = m_talents[m_activeSpec].find(tempIter->first);
|
||||||
(*specIter).second.state = talent.state;
|
if (specIter != m_talents[m_activeSpec].end())
|
||||||
|
(*specIter).second.state = talent.state;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sLog.outError("ActivateSpec: Talent spell %u expected to learned at spec switch but not listed in talents at final check!", talentSpellId);
|
||||||
|
|
||||||
|
// attempt resync DB state (deleted lost spell from DB)
|
||||||
|
if (talent.state != PLAYERSPELL_NEW)
|
||||||
|
{
|
||||||
|
PlayerTalent& talentNew = m_talents[m_activeSpec][tempIter->first];
|
||||||
|
talentNew = talent;
|
||||||
|
talentNew.state = PLAYERSPELL_REMOVED;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
InitTalentForLevel();
|
InitTalentForLevel();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9693"
|
#define REVISION_NR "9694"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue