Backed out changeset "[8251] Store in some DB tables only data for first rank. Author: VladimirMangos" until support for different values for ranks and for custom ranks is added.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-07-31 13:21:01 +02:00
parent 2bddcc4303
commit 1f53433c6c
7 changed files with 145 additions and 533 deletions
+7 -25
View File
@@ -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))