diff --git a/src/strategy/actions/MovementActions.cpp b/src/strategy/actions/MovementActions.cpp index 9eb05039..67cb4902 100644 --- a/src/strategy/actions/MovementActions.cpp +++ b/src/strategy/actions/MovementActions.cpp @@ -1711,13 +1711,11 @@ Position AvoidAoeAction::BestPositionForRanged(Position pos, float radius) Position fleePos{bot->GetPositionX() + cos(angle) * fleeDis, bot->GetPositionY() + sin(angle) * fleeDis, bot->GetPositionZ()}; - // backward, flee - if (currentTarget && (angle == angleToTarget + M_PI || angle == angleFleeFromCenter) + if (currentTarget // && (angle == angleToTarget + M_PI || angle == angleFleeFromCenter) && fleePos.GetExactDist(currentTarget) > sPlayerbotAIConfig->spellDistance) { continue; } - // forward, flee - if (currentTarget && (angle == angleToTarget || angle == angleFleeFromCenter) + if (currentTarget // && (angle == angleToTarget || angle == angleFleeFromCenter) && fleePos.GetExactDist(currentTarget) < (sPlayerbotAIConfig->tooCloseDistance + 5.0f)) { continue; } @@ -1737,7 +1735,7 @@ bool AvoidAoeAction::FleePosition(Position pos, float radius, std::string name) Position bestPos; if (botAI->IsMelee(bot)) { bestPos = BestPositionForMelee(pos, radius); - } else if (botAI->IsRanged(bot)) { + } else { bestPos = BestPositionForRanged(pos, radius); } if (bestPos != Position()) { diff --git a/src/strategy/values/AoeValues.cpp b/src/strategy/values/AoeValues.cpp index b27fc307..e3f44bb2 100644 --- a/src/strategy/values/AoeValues.cpp +++ b/src/strategy/values/AoeValues.cpp @@ -125,7 +125,8 @@ Aura* AreaDebuffValue::Calculate() Unit::AuraEffectList const& aurasPeriodicDamagePercent = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); Unit::AuraEffectList const& aurasPeriodicTriggerSpell = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL); Unit::AuraEffectList const& aurasPeriodicTriggerWithValueSpell = bot->GetAuraEffectsByType(SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE); - for (const Unit::AuraEffectList& list : {aurasPeriodicDamage, aurasPeriodicDamagePercent, aurasPeriodicTriggerSpell, aurasPeriodicTriggerWithValueSpell}) { + Unit::AuraEffectList const& aurasDummy = bot->GetAuraEffectsByType(SPELL_AURA_DUMMY); + for (const Unit::AuraEffectList& list : {aurasPeriodicDamage, aurasPeriodicDamagePercent, aurasPeriodicTriggerSpell, aurasPeriodicTriggerWithValueSpell, aurasDummy}) { for (auto i = list.begin(); i != list.end(); ++i) { AuraEffect* aurEff = *i;