[Avoid aoe] Area debuff judgement

This commit is contained in:
Yunfan Li
2024-04-19 18:32:15 +08:00
parent 32f787b2aa
commit 7af4f3bb95

View File

@@ -121,8 +121,10 @@ bool HasAreaDebuffValue::Calculate()
Aura* AreaDebuffValue::Calculate() Aura* AreaDebuffValue::Calculate()
{ {
// Unit::AuraApplicationMap& map = bot->GetAppliedAuras(); // Unit::AuraApplicationMap& map = bot->GetAppliedAuras();
Unit::AuraEffectList const& auras = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE); Unit::AuraEffectList const& aurasPeriodicDamage = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
for (auto i = auras.begin(); i != auras.end(); ++i) Unit::AuraEffectList const& aurasPeriodicTriggerSpell = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL);
for (const Unit::AuraEffectList& list : {aurasPeriodicDamage, aurasPeriodicTriggerSpell}) {
for (auto i = list.begin(); i != list.end(); ++i)
{ {
AuraEffect* aurEff = *i; AuraEffect* aurEff = *i;
Aura *aura = aurEff->GetBase(); Aura *aura = aurEff->GetBase();
@@ -136,22 +138,6 @@ Aura* AreaDebuffValue::Calculate()
return aura; return aura;
} }
} }
// for (Unit::AuraApplicationMap::iterator i = map.begin(); i != map.end(); ++i) }
// {
// Aura *aura = i->second->GetBase();
// if (!aura)
// continue;
// AuraObjectType type = aura->GetType();
// // bool is_area = aura->IsArea();
// bool isPositive = aura->GetSpellInfo()->IsPositive();
// if (type == DYNOBJ_AURA_TYPE && !isPositive) {
// DynamicObject* dynOwner = aura->GetDynobjOwner();
// if (!dynOwner) {
// continue;
// }
// return aura;
// }
// }
return nullptr; return nullptr;
} }