Fix #1167
This commit is contained in:
parent
512765a37d
commit
152d49ef20
|
@ -204,8 +204,8 @@ minetest.register_globalstep(function(dtime)
|
|||
--[[ Swimming: Cause exhaustion.
|
||||
NOTE: As of 0.4.15, it only counts as swimming when you are with the feet inside the liquid!
|
||||
Head alone does not count. We respect that for now. ]]
|
||||
if minetest.get_item_group(node_feet, "liquid") ~= 0 or
|
||||
minetest.get_item_group(node_stand, "liquid") ~= 0 then
|
||||
if not player:get_attach() and (minetest.get_item_group(node_feet, "liquid") ~= 0 or
|
||||
minetest.get_item_group(node_stand, "liquid") ~= 0) then
|
||||
local lastPos = mcl_playerplus_internal[name].lastPos
|
||||
if lastPos then
|
||||
local dist = vector.distance(lastPos, pos)
|
||||
|
|
|
@ -115,7 +115,7 @@ minetest.register_globalstep(function(dtime)
|
|||
|
||||
local playerPos = player:get_pos()
|
||||
--If the player is sprinting, create particles behind and cause exhaustion
|
||||
if playerInfo["sprinting"] == true and gameTime % 0.1 == 0 then
|
||||
if playerInfo["sprinting"] == true and not player:get_attach() and gameTime % 0.1 == 0 then
|
||||
|
||||
-- Exhaust player for sprinting
|
||||
local lastPos = players[playerName].lastPos
|
||||
|
@ -158,7 +158,7 @@ minetest.register_globalstep(function(dtime)
|
|||
if players[playerName]["shouldSprint"] == true then --Stopped
|
||||
local sprinting
|
||||
-- Prevent sprinting if hungry or sleeping
|
||||
if (mcl_hunger.active and mcl_hunger.get_hunger(player) <= 6) or (player:get_meta():get_string("mcl_beds:sleeping") == "true")then
|
||||
if (mcl_hunger.active and mcl_hunger.get_hunger(player) <= 6) or (player:get_meta():get_string("mcl_beds:sleeping") == "true") then
|
||||
sprinting = false
|
||||
else
|
||||
sprinting = true
|
||||
|
|
Loading…
Reference in New Issue