mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-14 15:11:05 +01:00
Fix crash when sprinting
This commit is contained in:
parent
7da471386b
commit
c60cff8f81
3 changed files with 3 additions and 2 deletions
|
@ -62,7 +62,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
if players[playerName]["shouldSprint"] == true then --Stopped
|
if players[playerName]["shouldSprint"] == true then --Stopped
|
||||||
local sprinting
|
local sprinting
|
||||||
-- Prevent sprinting if standing on soul sand or hungry
|
-- Prevent sprinting if standing on soul sand or hungry
|
||||||
if playerplus[playerName].nod_stand == "mcl_nether:soul_sand" or mcl_hunger.get_hunger(player) <= 6 then
|
if playerplus[playerName].nod_stand == "mcl_nether:soul_sand" or (mcl_hunger and mcl_hunger.get_hunger(player) <= 6) then
|
||||||
sprinting = false
|
sprinting = false
|
||||||
else
|
else
|
||||||
sprinting = true
|
sprinting = true
|
||||||
|
|
1
mods/PLAYER/mcl_sprint/mod.conf
Normal file
1
mods/PLAYER/mcl_sprint/mod.conf
Normal file
|
@ -0,0 +1 @@
|
||||||
|
name = mcl_sprint
|
|
@ -61,7 +61,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Prevent sprinting if standing on soul sand or hungry
|
-- Prevent sprinting if standing on soul sand or hungry
|
||||||
local can_sprint = (playerplus[playerName].nod_stand ~= "mcl_nether:soul_sand") and (mcl_hunger.get_hunger(player) <= 6)
|
local can_sprint = (playerplus[playerName].nod_stand ~= "mcl_nether:soul_sand") or (mcl_hunger and mcl_hunger.get_hunger(player) <= 6)
|
||||||
--Adjust player states
|
--Adjust player states
|
||||||
if players[playerName]["moving"] == false and playerInfo["state"] == 3 then --Stopped
|
if players[playerName]["moving"] == false and playerInfo["state"] == 3 then --Stopped
|
||||||
setState(playerName, 0)
|
setState(playerName, 0)
|
||||||
|
|
Loading…
Reference in a new issue