From 979b0278dabc46f45d81a29aac5e2b687676d44e Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 13 Sep 2020 22:47:21 -0400 Subject: [PATCH] CDrone: StrafeFromCompanions fixes --- Runtime/MP1/World/CDrone.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Runtime/MP1/World/CDrone.cpp b/Runtime/MP1/World/CDrone.cpp index c7fae0256..2a547b129 100644 --- a/Runtime/MP1/World/CDrone.cpp +++ b/Runtime/MP1/World/CDrone.cpp @@ -963,15 +963,15 @@ void CDrone::StrafeFromCompanions(CStateManager& mgr) { } } - if (nearestPos.isZero()) + if (nearestPos.isZero() || minDist > x61c_ * x61c_) return; - zeus::CVector3f off = nearestPos - GetTranslation(); - const float rightOff = GetTransform().basis[0].dot(off); - if (rightOff > -0.2f && rightOff < 0.2f) { - x450_bodyController->GetCommandMgr().DeliverCmd(CBCStepCmd(pas::EStepDirection::Left, pas::EStepType::Normal)); - } else { + const auto off = nearestPos - GetTranslation(); + const float rightOff = GetTransform().rightVector().dot(off); + if (rightOff < -0.2f) { x450_bodyController->GetCommandMgr().DeliverCmd(CBCStepCmd(pas::EStepDirection::Right, pas::EStepType::Normal)); + } else if (rightOff > 0.2f) { + x450_bodyController->GetCommandMgr().DeliverCmd(CBCStepCmd(pas::EStepDirection::Left, pas::EStepType::Normal)); } }