From 3659bedad19c02a4aed51c8fca716e5f274e8555 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 13 Sep 2020 22:40:51 -0400 Subject: [PATCH] CDrone: Fix detection range in SpotPlayer --- Runtime/MP1/World/CDrone.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Runtime/MP1/World/CDrone.cpp b/Runtime/MP1/World/CDrone.cpp index 6a3e1a548..c7fae0256 100644 --- a/Runtime/MP1/World/CDrone.cpp +++ b/Runtime/MP1/World/CDrone.cpp @@ -803,13 +803,13 @@ bool CDrone::InRange(CStateManager& mgr, float arg) { } bool CDrone::SpotPlayer(CStateManager& mgr, float arg) { - if ((mgr.GetPlayer().GetTranslation() - GetTranslation()).magSquared() > x3bc_detectionRange) + if ((mgr.GetPlayer().GetTranslation() - GetTranslation()).magSquared() > x3bc_detectionRange * x3bc_detectionRange) return false; if (!LineOfSight(mgr, arg)) return false; - return (GetTransform().basis[1] + x5cc_ * GetTransform().basis[0]) + return (GetTransform().frontVector() + x5cc_ * GetTransform().rightVector()) .normalized() .dot((mgr.GetPlayer().GetAimPosition(mgr, 0.f) - GetTranslation()).normalized()) > 0.5f; }