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