aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2019-02-09 21:44:04 +0100
committerGitHub <noreply@github.com>2019-02-09 21:44:04 +0100
commit6d6a813614360e0677b0da4108cc00b20657634f (patch)
tree00b37b61836f92200b68d0a4d38b87c8f8333aec /src/client
parent705b454026d9c49e62bf94857f7b83d19d3ef81c (diff)
downloadminetest-6d6a813614360e0677b0da4108cc00b20657634f.tar.gz
minetest-6d6a813614360e0677b0da4108cc00b20657634f.tar.bz2
minetest-6d6a813614360e0677b0da4108cc00b20657634f.zip
Autojump: Disable in fly mode, support continuous forward (#8200)
Correctly disable in fly mode (issue #8199) Also autojump in continuous forward mode (issue #8201)
Diffstat (limited to 'src/client')
-rw-r--r--src/client/localplayer.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/client/localplayer.cpp b/src/client/localplayer.cpp
index dbb50d397..c627cc6d9 100644
--- a/src/client/localplayer.cpp
+++ b/src/client/localplayer.cpp
@@ -611,6 +611,12 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
speedH += v3f(1,0,0) *
(control.sidew_move_joystick_axis / 32767.f);
}
+ if (m_autojump) {
+ // release autojump after a given time
+ m_autojump_time -= dtime;
+ if (m_autojump_time <= 0.0f)
+ m_autojump = false;
+ }
if(control.jump)
{
if (free_move) {
@@ -1102,17 +1108,12 @@ void LocalPlayer::handleAutojump(f32 dtime, Environment *env,
if (!player_settings.autojump)
return;
- if (m_autojump) {
- // release autojump after a given time
- m_autojump_time -= dtime;
- if (m_autojump_time <= 0.0f)
- m_autojump = false;
+ if (m_autojump)
return;
- }
- bool control_forward = control.up ||
- (!control.up && !control.down &&
- control.forw_move_joystick_axis < -0.05);
+ bool control_forward = control.up || player_settings.continuous_forward ||
+ (!control.up && !control.down &&
+ control.forw_move_joystick_axis < -0.05);
bool could_autojump =
m_can_jump && !control.jump && !control.sneak && control_forward;
if (!could_autojump)