From a97934e1880b6821ac453e9452f9698eaf74c10a Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 28 Dec 2024 10:30:07 -0700 Subject: [PATCH] Match `LegoNavController::ProcessKeyboardInput` (#1298) --- .../legoomni/src/entity/legonavcontroller.cpp | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp index da82d9a7..9a7bf108 100644 --- a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp @@ -582,29 +582,33 @@ MxResult LegoNavController::ProcessKeyboardInput() m_unk0x6c = TRUE; MxS32 hMax; - if ((keyFlags & LegoInputManager::c_leftOrRight) == LegoInputManager::c_left) { + switch (keyFlags & LegoInputManager::c_leftOrRight) { + case LegoInputManager::c_left: hMax = 0; - } - else if ((keyFlags & LegoInputManager::c_leftOrRight) == LegoInputManager::c_right) { + break; + case LegoInputManager::c_right: hMax = m_hMax; - } - else { + break; + default: m_targetRotationalVel = 0.0; m_rotationalAccel = m_maxRotationalDeccel; bool1 = TRUE; + break; } MxS32 vMax; - if ((keyFlags & LegoInputManager::c_upOrDown) == LegoInputManager::c_up) { + switch (keyFlags & LegoInputManager::c_upOrDown) { + case LegoInputManager::c_up: vMax = 0; - } - else if ((keyFlags & LegoInputManager::c_upOrDown) == LegoInputManager::c_down) { + break; + case LegoInputManager::c_down: vMax = m_vMax; - } - else { + break; + default: m_targetLinearVel = 0.0; m_linearAccel = m_maxLinearDeccel; bool2 = TRUE; + break; } MxFloat val = keyFlags & LegoInputManager::c_bit5 ? 1.0f : 4.0f;