Prevent sprinting if hunger level <= 6

This commit is contained in:
Wuzzy 2017-02-21 16:44:26 +01:00
parent 2e7ce77985
commit d36beaf64f
5 changed files with 13 additions and 10 deletions

View file

@ -61,8 +61,8 @@ minetest.register_globalstep(function(dtime)
--Adjust player states
if players[playerName]["shouldSprint"] == true then --Stopped
local sprinting
-- Prevent sprinting if standing on soul sand
if playerplus[playerName].nod_stand == "mcl_nether:soul_sand" then
-- 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
sprinting = false
else
sprinting = true