From f3a5add038ec29ce59069eadbd67cd99b9dad5b6 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Mon, 18 May 2026 03:15:03 -0700 Subject: [PATCH] fix(tac arc): incorrect check causing any enemy lower than you to not attack you (#1975) tested that close range enemies above and below you now correctly attack you --- dGame/dBehaviors/TacArcBehavior.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dGame/dBehaviors/TacArcBehavior.cpp b/dGame/dBehaviors/TacArcBehavior.cpp index d0bbad8e..616651f5 100644 --- a/dGame/dBehaviors/TacArcBehavior.cpp +++ b/dGame/dBehaviors/TacArcBehavior.cpp @@ -119,9 +119,8 @@ void TacArcBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitS const auto targetPos = validTarget->GetPosition(); - // make sure we aren't too high or low in comparison to the targer - const auto heightDifference = std::abs(reference.y - targetPos.y); - if (targetPos.y > reference.y && heightDifference > this->m_upperBound || targetPos.y < reference.y && heightDifference > this->m_lowerBound) + // make sure we aren't too high or low in comparison to the target + if (targetPos.y > (reference.y + m_upperBound) || targetPos.y < (reference.y + m_lowerBound)) continue; const auto forward = QuatUtils::Forward(self->GetRotation()); @@ -210,7 +209,7 @@ void TacArcBehavior::Load() { ); this->m_method = GetInt("method", 1); this->m_upperBound = std::abs(GetFloat("upper_bound", 4.4f)); - this->m_lowerBound = std::abs(GetFloat("lower_bound", 0.4f)); + this->m_lowerBound = std::abs(GetFloat("lower_bound", 0.4f)) - 5.0f; // Makes it so players and objects can still be targetted when slightly below the caster. FIXME: use bounding spheres at some point this->m_usePickedTarget = GetBoolean("use_picked_target", false); this->m_useTargetPostion = GetBoolean("use_target_position", false); this->m_checkEnv = GetBoolean("check_env", false);