Revert "Removed unneccessary entitylist check from ApplySpellBonuses"

This commit is contained in:
KayenEQ
2016-03-27 10:36:49 -04:00
parent 9f7b67417f
commit cc554be1df
20 changed files with 13 additions and 32184 deletions
+5 -12
View File
@@ -1270,9 +1270,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Melee Absorb Rune: %+i", effect_value);
#endif
if (caster)
effect_value = caster->ApplySpellEffectiveness(spell_id, effect_value);
effect_value = ApplySpellEffectiveness(caster, spell_id, effect_value);
buffs[buffslot].melee_rune = effect_value;
break;
}
@@ -3022,7 +3020,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
}
int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, uint32 instrument_mod, Mob *caster,
int ticsremaining, uint16 caster_id)
int ticsremaining)
{
int formula, base, max, effect_value;
@@ -3050,7 +3048,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level,
spells[spell_id].effectid[effect_id] != SE_ManaRegen_v2) {
int oval = effect_value;
int mod = ApplySpellEffectiveness(spell_id, instrument_mod, true, caster_id);
int mod = ApplySpellEffectiveness(caster, spell_id, instrument_mod, true);
effect_value = effect_value * mod / 10;
Log.Out(Logs::Detail, Logs::Spells, "Effect value %d altered with bard modifier of %d to yeild %d",
oval, mod, effect_value);
@@ -6045,21 +6043,16 @@ int32 Mob::GetFocusIncoming(focusType type, int effect, Mob *caster, uint32 spel
return value;
}
int32 Mob::ApplySpellEffectiveness(int16 spell_id, int32 value, bool IsBard, uint16 caster_id) {
int32 Mob::ApplySpellEffectiveness(Mob* caster, int16 spell_id, int32 value, bool IsBard) {
// 9-17-12: This is likely causing crashes, disabled till can resolve.
if (IsBard)
return value;
Mob* caster = this;
if (caster_id && caster_id != GetID())//Make sure we are checking the casters focus
caster = entity_list.GetMob(caster_id);
if (!caster)
return value;
int16 focus = caster->GetFocusEffect(focusFcBaseEffects, spell_id);
int16 focus = GetFocusEffect(focusFcBaseEffects, spell_id);
if (IsBard)
value += focus;