aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-07-27 23:44:29 +0200
committersfan5 <sfan5@live.de>2022-07-29 10:19:23 +0200
commit6611d7e1ee3b078b5c3414bf57833755d8b43620 (patch)
tree7dcbb2d59a09c0418230bc662c2394600258b933 /src/client
parentf0703f3c5b8ed51d2c7caf83ffe547bf54bc1eb1 (diff)
downloadminetest-6611d7e1ee3b078b5c3414bf57833755d8b43620.tar.gz
minetest-6611d7e1ee3b078b5c3414bf57833755d8b43620.tar.bz2
minetest-6611d7e1ee3b078b5c3414bf57833755d8b43620.zip
Allow direction keys with autoforward again
This was unintentionally removed in commit 1d69a23. fixes #12048
Diffstat (limited to 'src/client')
-rw-r--r--src/client/game.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index caa83ce13..61b957e78 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -2510,11 +2510,13 @@ void Game::updatePlayerControl(const CameraOrientation &cam)
input->getMovementDirection()
);
- // autoforward if set: move towards pointed position at maximum speed
+ // autoforward if set: move at maximum speed
if (player->getPlayerSettings().continuous_forward &&
client->activeObjectsReceived() && !player->isDead()) {
control.movement_speed = 1.0f;
- control.movement_direction = 0.0f;
+ // sideways movement only
+ float dx = sin(control.movement_direction);
+ control.movement_direction = atan2(dx, 1.0f);
}
#ifdef HAVE_TOUCHSCREENGUI