Move check to the top of the function
This commit is contained in:
parent
323a1f6e18
commit
8556226cf7
|
@ -65,9 +65,9 @@ local function cancelClientSprinting(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting)
|
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 player = minetest.get_player_by_name(playerName)
|
||||||
local controls = player:get_player_control()
|
local controls = player:get_player_control()
|
||||||
if not sprinting and not mcl_sprint.is_sprinting(playerName) then return end
|
|
||||||
if players[playerName] then
|
if players[playerName] then
|
||||||
players[playerName].sprinting = sprinting
|
players[playerName].sprinting = sprinting
|
||||||
local fov_old = players[playerName].fov
|
local fov_old = players[playerName].fov
|
||||||
|
|
Loading…
Reference in New Issue
Block a user