From 718489923b4dd5a3f12d53510d299033924c5dea Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Sun, 23 Jul 2023 18:54:03 -0400 Subject: [PATCH] LegoNavController: Match CalculateNewTargetSpeed Ghidra showed this correctly too, but the asm showed the problem simply, an incorrect comparison --- LEGO1/legonavcontroller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LEGO1/legonavcontroller.cpp b/LEGO1/legonavcontroller.cpp index 90c0a485..6cc0b57b 100644 --- a/LEGO1/legonavcontroller.cpp +++ b/LEGO1/legonavcontroller.cpp @@ -155,7 +155,7 @@ float LegoNavController::CalculateNewTargetSpeed(int p_pos, int p_center, float float result; int diff = p_pos - p_center; - if (diff > this->m_mouseDeadzone) + if (diff < this->m_mouseDeadzone) result = (diff - m_mouseDeadzone) * p_maxSpeed / (p_center - m_mouseDeadzone); else if (diff < -m_mouseDeadzone) result = (diff + m_mouseDeadzone) * p_maxSpeed / (p_center - m_mouseDeadzone);