forked from Mirrorlandia_minetest/minetest
Autojump: Disable in fly mode, support continuous forward (#8200)
Correctly disable in fly mode (issue #8199) Also autojump in continuous forward mode (issue #8201)
This commit is contained in:
parent
705b454026
commit
6d6a813614
@ -611,6 +611,12 @@ void LocalPlayer::applyControl(float dtime, Environment *env)
|
|||||||
speedH += v3f(1,0,0) *
|
speedH += v3f(1,0,0) *
|
||||||
(control.sidew_move_joystick_axis / 32767.f);
|
(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(control.jump)
|
||||||
{
|
{
|
||||||
if (free_move) {
|
if (free_move) {
|
||||||
@ -1102,15 +1108,10 @@ void LocalPlayer::handleAutojump(f32 dtime, Environment *env,
|
|||||||
if (!player_settings.autojump)
|
if (!player_settings.autojump)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_autojump) {
|
if (m_autojump)
|
||||||
// release autojump after a given time
|
|
||||||
m_autojump_time -= dtime;
|
|
||||||
if (m_autojump_time <= 0.0f)
|
|
||||||
m_autojump = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
bool control_forward = control.up ||
|
bool control_forward = control.up || player_settings.continuous_forward ||
|
||||||
(!control.up && !control.down &&
|
(!control.up && !control.down &&
|
||||||
control.forw_move_joystick_axis < -0.05);
|
control.forw_move_joystick_axis < -0.05);
|
||||||
bool could_autojump =
|
bool could_autojump =
|
||||||
|
Loading…
Reference in New Issue
Block a user