Fix out of bounds in Mob::ResourceTap

This commit is contained in:
Michael Cook (mackal) 2015-01-13 00:36:25 -05:00
parent 390681e0d0
commit e0602efca2

View File

@ -6570,15 +6570,14 @@ bool Mob::TrySpellProjectile(Mob* spell_target, uint16 spell_id, float speed){
return true; return true;
} }
void Mob::ResourceTap(int32 damage, uint16 spellid){ void Mob::ResourceTap(int32 damage, uint16 spellid)
{
//'this' = caster //'this' = caster
if (!IsValidSpell(spellid)) if (!IsValidSpell(spellid))
return; return;
for (int i = 0; i <= EFFECT_COUNT; i++) for (int i = 0; i < EFFECT_COUNT; i++) {
{
if (spells[spellid].effectid[i] == SE_ResourceTap) { if (spells[spellid].effectid[i] == SE_ResourceTap) {
damage += (damage * spells[spellid].base[i]) / 100; damage += (damage * spells[spellid].base[i]) / 100;
if (spells[spellid].max[i] && (damage > spells[spellid].max[i])) if (spells[spellid].max[i] && (damage > spells[spellid].max[i]))