From 323a1f6e1894d4021e7192dfb5e5dc8c3fa548ca Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 24 Jul 2022 12:55:37 +0200 Subject: [PATCH 1/2] Fix mcl_sprint globalstep taking long --- mods/PLAYER/mcl_sprint/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/PLAYER/mcl_sprint/init.lua b/mods/PLAYER/mcl_sprint/init.lua index 4c0d609c96..762ac5fb21 100644 --- a/mods/PLAYER/mcl_sprint/init.lua +++ b/mods/PLAYER/mcl_sprint/init.lua @@ -67,6 +67,7 @@ end local function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting) 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 From 8556226cf718c11c98e6de2844f68125d916d362 Mon Sep 17 00:00:00 2001 From: cora Date: Sun, 24 Jul 2022 23:38:24 +0200 Subject: [PATCH 2/2] 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 762ac5fb21..7449ad18c2 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