From 8556226cf718c11c98e6de2844f68125d916d362 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 24 Jul 2022 23:38:24 +0200 Subject: [PATCH] Move check to the top of the function --- mods/PLAYER/mcl_sprint/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_sprint/init.lua b/mods/PLAYER/mcl_sprint/init.lua index 762ac5fb2..7449ad18c 100644 --- a/mods/PLAYER/mcl_sprint/init.lua +++ b/mods/PLAYER/mcl_sprint/init.lua @@ -65,9 +65,9 @@ local function cancelClientSprinting(name) end local function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting) + if not sprinting and not mcl_sprint.is_sprinting(playerName) then return end local player = minetest.get_player_by_name(playerName) local controls = player:get_player_control() - if not sprinting and not mcl_sprint.is_sprinting(playerName) then return end if players[playerName] then players[playerName].sprinting = sprinting local fov_old = players[playerName].fov