diff --git a/zone/hate_list.cpp b/zone/hate_list.cpp index dfa6e30a8..6d7d04496 100644 --- a/zone/hate_list.cpp +++ b/zone/hate_list.cpp @@ -539,13 +539,13 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption auto it = list.begin(); while (it != list.end() && (count == -1 || hit_count < count)) { struct_HateList *h = (*it); + ++it; // advancing the iterator here prevents the iterator being invalidated if they die if (h && h->entity_on_hatelist && h->entity_on_hatelist != caster) { if (caster->CombatRange(h->entity_on_hatelist)) { ++hit_count; caster->ProcessAttackRounds(h->entity_on_hatelist, opts); } } - ++it; } return hit_count; diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index b9394f9a3..9a483fddd 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2000,7 +2000,7 @@ void Mob::AreaRampage(ExtraAttackOptions *opts) } int rampage_targets = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 1); - rampage_targets = rampage_targets > 0 ? rampage_targets : 1; + rampage_targets = rampage_targets > 0 ? rampage_targets : -1; index_hit = hate_list.AreaRampage(this, GetTarget(), rampage_targets, opts); if(index_hit == 0)