From 025ef5e1d68ccaa5b757e08c135d418c7cec5693 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Wed, 5 Apr 2023 11:14:28 -0400 Subject: [PATCH] [Cleanup] Move unreachable code in ApplySpellsBonuses() (#3229) # Notes - This code was unreachable since it was inside the switch and should have been checked on its own in the condition where we verify we are using AISpellEffects. --- zone/bonuses.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 1f4ec3ac5..367d2f4c9 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -2115,10 +2115,17 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne //Use AISpellEffects else { spell_effect_id = effect_id; - effect_value = se_base; - limit_value = se_limit; - max_value = se_max; - i = (EFFECT_COUNT - 1); // AISpellEffects do a single pass + effect_value = se_base; + limit_value = se_limit; + max_value = se_max; + + //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table + //Non-Focused Effect to modify incoming spell damage by resist type. + if (spell_effect_id == SE_FcSpellVulnerability) { + ModVulnerability(limit_value, effect_value); + } + + break; } switch (spell_effect_id) @@ -4068,15 +4075,6 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_TrapCircumvention: new_bonus->TrapCircumvention += effect_value; break; - - //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table - if (IsAISpellEffect) { - - //Non-Focused Effect to modify incoming spell damage by resist type. - case SE_FcSpellVulnerability: - ModVulnerability(limit_value, effect_value); - break; - } } } }