CDrone: Fix detection range in SpotPlayer

This commit is contained in:
Luke Street 2020-09-13 22:40:51 -04:00
parent 04a377c68e
commit 3659bedad1
1 changed files with 2 additions and 2 deletions

View File

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