mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 20:41:33 +00:00
Fix AE Ramp iterator issue
This commit is contained in:
parent
b98bc207fb
commit
7fc8841a67
@ -539,13 +539,13 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption
|
|||||||
auto it = list.begin();
|
auto it = list.begin();
|
||||||
while (it != list.end() && (count == -1 || hit_count < count)) {
|
while (it != list.end() && (count == -1 || hit_count < count)) {
|
||||||
struct_HateList *h = (*it);
|
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 (h && h->entity_on_hatelist && h->entity_on_hatelist != caster) {
|
||||||
if (caster->CombatRange(h->entity_on_hatelist)) {
|
if (caster->CombatRange(h->entity_on_hatelist)) {
|
||||||
++hit_count;
|
++hit_count;
|
||||||
caster->ProcessAttackRounds(h->entity_on_hatelist, opts);
|
caster->ProcessAttackRounds(h->entity_on_hatelist, opts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++it;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return hit_count;
|
return hit_count;
|
||||||
|
|||||||
@ -2000,7 +2000,7 @@ void Mob::AreaRampage(ExtraAttackOptions *opts)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int rampage_targets = GetSpecialAbilityParam(SPECATK_AREA_RAMPAGE, 1);
|
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);
|
index_hit = hate_list.AreaRampage(this, GetTarget(), rampage_targets, opts);
|
||||||
|
|
||||||
if(index_hit == 0)
|
if(index_hit == 0)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user