aboutsummaryrefslogtreecommitdiff
path: root/src/game/SpellMgr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/SpellMgr.h')
-rw-r--r--src/game/SpellMgr.h32
1 files changed, 7 insertions, 25 deletions
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index be34f4af2eb..f1d551298f0 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -729,10 +729,6 @@ inline bool IsProfessionOrRidingSkill(uint32 skill)
class SpellMgr
{
- friend struct DoSpellBonusess;
- friend struct DoSpellProcEvent;
- friend struct DoSpellProcItemEnchant;
-
// Constructors
public:
SpellMgr();
@@ -802,7 +798,13 @@ class SpellMgr
SpellBonusMap::const_iterator itr = mSpellBonusMap.find(spellId);
if( itr != mSpellBonusMap.end( ) )
return &itr->second;
-
+ // Not found, try lookup for 1 spell rank if exist
+ if (uint32 rank_1 = GetFirstSpellInChain(spellId))
+ {
+ SpellBonusMap::const_iterator itr2 = mSpellBonusMap.find(rank_1);
+ if( itr2 != mSpellBonusMap.end( ) )
+ return &itr2->second;
+ }
return NULL;
}
@@ -860,26 +862,6 @@ class SpellMgr
SpellsRequiringSpellMap const& GetSpellsRequiringSpell() const { return mSpellsReqSpell; }
- template<typename Worker>
- void doForThisAndHighRanks(uint32 spellid, Worker& worker)
- {
- worker(spellid);
- if(uint32 nextSpellId = GetNextSpellInChain(spellid))
- doForThisAndHighRanks(nextSpellId, worker);
- }
-
- template<typename Worker>
- void doForHighRanks(uint32 spellid, Worker& worker)
- {
- if(uint32 nextSpellId = GetNextSpellInChain(spellid))
- {
- worker(nextSpellId);
- doForHighRanks(nextSpellId, worker);
- }
- }
-
- // Note: not use rank for compare to spell ranks: spell chains isn't linear order
- // Use IsHighRankOfSpell instead
uint8 GetSpellRank(uint32 spell_id) const
{
if(SpellChainNode const* node = GetSpellChainNode(spell_id))