[10430] Improve detection removed ranks for spell in spell_chain

This commit is contained in:
VladimirMangos 2010-08-31 19:01:38 +04:00
parent 055c6b4184
commit 7df3f06d87
6 changed files with 37 additions and 53 deletions

View file

@ -2627,6 +2627,34 @@ void SpellMgr::LoadSpellChains()
continue;
}*/
}
}
// removed ranks often still listed as forward in skill abilities but not listed as spell in it
if (node.prev)
{
bool skip = false;
// some forward spells still exist but excluded from real use as ranks and not listed in skill abilities now
SkillLineAbilityMap::const_iterator forward_ab_low = mSkillLineAbilityMap.lower_bound(spell_id);
SkillLineAbilityMap::const_iterator forward_ab_up = mSkillLineAbilityMap.upper_bound(spell_id);
if (forward_ab_low == forward_ab_up)
{
for(SkillLineAbilityMap::const_iterator ab_itr = mSkillLineAbilityMap.lower_bound(node.prev); ab_itr != mSkillLineAbilityMap.upper_bound(node.prev); ++ab_itr)
{
// spell listed as forward and not listed as ability
// this is marker for removed ranks
if (ab_itr->second->forward_spellid == spell_id)
{
sLog.outErrorDb("Spell %u (prev: %u, first: %u, rank: %d, req: %u) listed in `spell_chain` is removed rank by DBC data.",
spell_id, node.prev, node.first, node.rank, node.req);
skip = true;
break;
}
}
}
if (skip)
continue;
}
mSpellChains[spell_id] = node;
@ -2697,7 +2725,7 @@ void SpellMgr::LoadSpellChains()
mSpellChainsNext.insert(SpellChainMapNext::value_type(node.req,spell_id));
}
// check single rank redundant cases (single rank talents not added by default so this can be only custom cases)
// check single rank redundant cases (single rank talents/spell abilities not added by default so this can be only custom cases)
for(SpellChainMap::const_iterator i = mSpellChains.begin(); i != mSpellChains.end(); ++i)
{
// skip non-first ranks, and spells with additional reqs