mirror of
https://github.com/minetest/minetest.git
synced 2025-03-06 20:48:40 +01:00
Touchscreen: Fix virtual joystick sometimes going backwards
This fixes a regression introduced by 34286d77c7
/ #14075.
This commit is contained in:
parent
c8b615acc9
commit
4f84b01356
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue