Prevent player from walking while sleeping
This commit is contained in:
parent
3121ab7c2d
commit
fd73c81d23
4 changed files with 10 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue