[9415] Dome not catched cases for MAX_EFFECT_INDEX use.

This commit is contained in:
VladimirMangos 2010-02-19 19:56:09 +03:00
parent 231720c10f
commit 233e75ab4b
6 changed files with 43 additions and 41 deletions

View file

@ -890,7 +890,7 @@ void ObjectMgr::LoadEquipmentTemplates()
if (!eqInfo)
continue;
for(uint8 j=0; j<3; j++)
for(uint8 j = 0; j < 3; ++j)
{
if (!eqInfo->equipentry[j])
continue;
@ -4406,7 +4406,7 @@ void ObjectMgr::LoadSpellScripts()
//check for correct spellEffect
bool found = false;
for(int i=0; i<3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
// skip empty effects
if (!spellInfo->Effect[i])
@ -4459,7 +4459,7 @@ void ObjectMgr::LoadEventScripts()
SpellEntry const * spell = sSpellStore.LookupEntry(i);
if (spell)
{
for(int j=0; j<3; ++j)
for(int j = 0; j < MAX_EFFECT_INDEX; ++j)
{
if( spell->Effect[j] == SPELL_EFFECT_SEND_EVENT )
{
@ -7957,7 +7957,7 @@ void ObjectMgr::LoadTrainerSpell()
// calculate learned spell for profession case when stored cast-spell
trainerSpell.learnedSpell = spell;
for(int i = 0; i <3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (spellinfo->Effect[i] != SPELL_EFFECT_LEARN_SPELL)
continue;

View file

@ -7205,7 +7205,7 @@ void Player::CastItemCombatSpell(Unit* Target, WeaponAttackType attType)
uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot));
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if(!pEnchant) continue;
for (int s=0;s<3;s++)
for (int s = 0; s < 3; ++s)
{
if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;
@ -7302,7 +7302,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c
uint32 enchant_id = item->GetEnchantmentId(EnchantmentSlot(e_slot));
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if(!pEnchant) continue;
for (int s=0;s<3;s++)
for (int s = 0; s < 3; ++s)
{
if(pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_USE_SPELL)
continue;

View file

@ -1677,7 +1677,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
if (!pEnchant)
return;
for (int s=0;s<3;s++)
for (int s = 0; s < 3; ++s)
{
if (pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue;

View file

@ -1872,7 +1872,7 @@ SpellEntry const* SpellMgr::SelectAuraRankForPlayerLevel(SpellEntry const* spell
return spellInfo;
bool needRankSelection = false;
for(int i=0;i<3;++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (IsPositiveEffect(spellInfo->Id, SpellEffectIndex(i)) && (
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA ||
@ -2340,7 +2340,7 @@ void SpellMgr::LoadSpellScriptTarget()
continue;
bool found = false;
for(int j=0; j<3; ++j)
for(int j = 0; j < MAX_EFFECT_INDEX; ++j)
{
if( spellInfo->EffectImplicitTargetA[j] == TARGET_SCRIPT || spellInfo->EffectImplicitTargetA[j] != TARGET_SELF && spellInfo->EffectImplicitTargetB[j] == TARGET_SCRIPT )
{
@ -2617,7 +2617,7 @@ bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
bool need_check_reagents = false;
// check effects
for(int i=0; i<3; ++i)
for(int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
switch(spellInfo->Effect[i])
{

View file

@ -6439,13 +6439,15 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
case 54939:
{
// Lookup base amount mana restore
for (int i=0; i<3;++i)
for (int i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (procSpell->Effect[i] == SPELL_EFFECT_ENERGIZE)
{
int32 mana = procSpell->EffectBasePoints[i];
CastCustomSpell(this, 54986, NULL, &mana, NULL, true, castItem, triggeredByAura);
break;
}
}
return true;
}
// Sacred Shield (buff)
@ -12849,7 +12851,7 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT
bool DirectDamage = false;
bool AreaEffect = false;
for ( uint32 i=0; i<3;++i)
for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
switch (spellProto->Effect[i])
{

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9414"
#define REVISION_NR "9415"
#endif // __REVISION_NR_H__