disable sprinting when player sneaks

This commit is contained in:
Dieter44 2021-11-24 16:48:12 +01:00
parent b60c914dcd
commit 60bf1393ff
1 changed files with 2 additions and 1 deletions

View File

@ -180,8 +180,9 @@ minetest.register_globalstep(function(dtime)
w_prev_pressed = false
w_double_pressed = false
end
--Check if the player should be sprinting
if players[playerName]["clientSprint"] or ctrl.aux1 or w_double_pressed and ctrl.up and ctrl.sneak==false then
if (players[playerName]["clientSprint"] or ctrl.aux1 or w_double_pressed) and ctrl.up and ctrl.sneak==false then
players[playerName]["shouldSprint"] = true
else
players[playerName]["shouldSprint"] = false