diff --git a/src/client/inputhandler.cpp b/src/client/inputhandler.cpp index 7b2e70b54..5c91898bc 100644 --- a/src/client/inputhandler.cpp +++ b/src/client/inputhandler.cpp @@ -237,7 +237,9 @@ float RealInputHandler::getMovementDirection() if (x != 0 || z != 0) /* If there is a keyboard event, it takes priority */ return std::atan2(x, z); - else if (g_touchscreengui && g_touchscreengui->getMovementDirection()) + // `getMovementDirection() == 0` means forward, so we cannot use + // `getMovementDirection()` as a condition. + else if (g_touchscreengui && g_touchscreengui->getMovementSpeed()) return g_touchscreengui->getMovementDirection(); return joystick.getMovementDirection(); }