Prevent player from walking while sleeping

This commit is contained in:
Wuzzy 2017-06-11 14:44:37 +02:00
parent 3121ab7c2d
commit fd73c81d23
4 changed files with 10 additions and 6 deletions

View file

@ -100,8 +100,8 @@ function setSprinting(playerName, sprinting) --Sets the state of a player (0=sto
local player = minetest.get_player_by_name(playerName)
if players[playerName] then
players[playerName]["sprinting"] = sprinting
-- Don't overwrite physics when standing on soul sand
if mcl_playerplus[playerName].node_stand ~= "mcl_nether:soul_sand" then
-- Don't overwrite physics when standing on soul sand or sleeping
if mcl_playerplus[playerName].node_stand ~= "mcl_nether:soul_sand" and player:get_attribute("mcl_beds:sleeping") ~= "true" then
if sprinting == true then
player:set_physics_override({speed=mcl_sprint.SPEED})
elseif sprinting == false then