mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 14:42:24 +01:00
Touchscreen: Fix virtual joystick sometimes going backwards
This fixes a regression introduced by 34286d77c7ee65be480a372233c5ab7c4b81d9db / #14075.
This commit is contained in:
parent
c8b615acc9
commit
4f84b01356
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user