[7093] Speedup spell learning code.

This commit is contained in:
VladimirMangos 2009-01-17 00:22:49 +03:00
parent ed14e59de4
commit a1e0900d37
2 changed files with 9 additions and 6 deletions

View file

@ -2855,13 +2855,16 @@ void Player::learnSpell(uint32 spell_id)
bool learning = addSpell(spell_id,active,true,false);
// learn all disabled higher ranks (recursive)
if(disabled)
{
SpellChainMapNext const& nextMap = spellmgr.GetSpellChainNext();
for(SpellChainMapNext::const_iterator i = nextMap.lower_bound(spell_id); i != nextMap.upper_bound(spell_id); ++i)
{
PlayerSpellMap::iterator iter = m_spells.find(i->second);
if (disabled && iter != m_spells.end() && iter->second->disabled)
if (iter != m_spells.end() && iter->second->disabled)
learnSpell(i->second);
}
}
// prevent duplicated entires in spell book, also not send if not in world (loading)
if(!learning || !IsInWorld ())

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7092"
#define REVISION_NR "7093"
#endif // __REVISION_NR_H__