mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7093] Speedup spell learning code.
This commit is contained in:
parent
ed14e59de4
commit
a1e0900d37
2 changed files with 9 additions and 6 deletions
|
|
@ -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 ())
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7092"
|
||||
#define REVISION_NR "7093"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue