LegoNavController: Match CalculateNewTargetSpeed

Ghidra showed this correctly too, but the asm showed the problem simply, an incorrect comparison
This commit is contained in:
Joshua Peisach 2023-07-23 18:54:03 -04:00
parent fa5417f58a
commit 718489923b
No known key found for this signature in database
GPG Key ID: 41C3D4189AFEDB5A

View File

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