mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Allow direction keys with autoforward again
This was unintentionally removed in commit 1d69a23
.
fixes #12048
This commit is contained in:
parent
f0703f3c5b
commit
6611d7e1ee
1 changed files with 4 additions and 2 deletions
|
@ -2510,11 +2510,13 @@ void Game::updatePlayerControl(const CameraOrientation &cam)
|
||||||
input->getMovementDirection()
|
input->getMovementDirection()
|
||||||
);
|
);
|
||||||
|
|
||||||
// autoforward if set: move towards pointed position at maximum speed
|
// autoforward if set: move at maximum speed
|
||||||
if (player->getPlayerSettings().continuous_forward &&
|
if (player->getPlayerSettings().continuous_forward &&
|
||||||
client->activeObjectsReceived() && !player->isDead()) {
|
client->activeObjectsReceived() && !player->isDead()) {
|
||||||
control.movement_speed = 1.0f;
|
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
|
#ifdef HAVE_TOUCHSCREENGUI
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue