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
This commit is contained in:
David Markowitz
2026-05-18 03:15:03 -07:00
committed by GitHub
parent f5d33a773a
commit f3a5add038

View File

@@ -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);