Correct when tanks can be hit by AE Rampage

Tanks will only be hit by AE Rampage if they're the only one on the
NPC's hate list. Others on hate list out ranging AE Rampage will also
prevent the tank from being hit by AE Rampage.
This commit is contained in:
Michael Cook (mackal) 2018-08-16 17:13:34 -04:00
parent ffb9323a98
commit ace81215a1
2 changed files with 8 additions and 3 deletions

View File

@ -575,12 +575,19 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption
if (!target || !caster)
return 0;
// tank will be hit ONLY if they are the only target on the hate list
// if there is anyone else on the hate list, the tank will not be hit, even if those others aren't hit either
if (list.size() == 1) {
caster->ProcessAttackRounds(target, opts);
return 1;
}
int hit_count = 0;
// This should prevent crashes if something dies (or mainly more than 1 thing goes away)
// This is a temp solution until the hate lists can be rewritten to not have that issue
std::vector<uint16> id_list;
for (auto &h : list) {
if (h->entity_on_hatelist && h->entity_on_hatelist != caster &&
if (h->entity_on_hatelist && h->entity_on_hatelist != caster && h->entity_on_hatelist != target &&
caster->CombatRange(h->entity_on_hatelist))
id_list.push_back(h->entity_on_hatelist->GetID());
if (count != -1 && id_list.size() > count)

View File

@ -2255,8 +2255,6 @@ void Mob::AreaRampage(ExtraAttackOptions *opts)
m_specialattacks = eSpecialAttacks::AERampage;
index_hit = hate_list.AreaRampage(this, GetTarget(), rampage_targets, opts);
if(index_hit == 0)
ProcessAttackRounds(GetTarget(), opts);
m_specialattacks = eSpecialAttacks::None;
}