Check the node below on globalstep, and if it's air just unmount (fixes #1)
cora, thanks again ^^
This commit is contained in:
parent
78ad6f1e6c
commit
90303158ad
22
init.lua
22
init.lua
|
@ -34,19 +34,25 @@ minetest.register_globalstep(function(dtime)
|
||||||
for i=1, #players do
|
for i=1, #players do
|
||||||
local name = players[i]:get_player_name()
|
local name = players[i]:get_player_name()
|
||||||
if mcl_player.player_attached[name] and not players[i]:get_attach() and
|
if mcl_player.player_attached[name] and not players[i]:get_attach() and
|
||||||
(players[i]:get_player_control().up == true or
|
(players[i]:get_player_control().up == true or
|
||||||
players[i]:get_player_control().down == true or
|
players[i]:get_player_control().down == true or
|
||||||
players[i]:get_player_control().left == true or
|
players[i]:get_player_control().left == true or
|
||||||
players[i]:get_player_control().right == true or
|
players[i]:get_player_control().right == true or
|
||||||
players[i]:get_player_control().jump == true or
|
players[i]:get_player_control().jump == true or
|
||||||
players[i]:get_player_control().sneak == true) then
|
players[i]:get_player_control().sneak == true) then
|
||||||
|
players[i]:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
|
||||||
|
players[i]:set_physics_override(1, 1, 1)
|
||||||
|
mcl_player.player_attached[name] = false
|
||||||
|
mcl_player.player_set_animation(players[i], "stand", 30)
|
||||||
|
end
|
||||||
|
-- check the node below player (and if it's air, just unmount)
|
||||||
|
if minetest.get_node(vector.offset(players[i]:get_pos(),0,-1,0)).name == "air" then
|
||||||
players[i]:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
|
players[i]:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
|
||||||
players[i]:set_physics_override(1, 1, 1)
|
players[i]:set_physics_override(1, 1, 1)
|
||||||
mcl_player.player_attached[name] = false
|
mcl_player.player_attached[name] = false
|
||||||
mcl_player.player_set_animation(players[i], "stand", 30)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_chatcommand("sit", {
|
minetest.register_chatcommand("sit", {
|
||||||
description = S("Sit down"),
|
description = S("Sit down"),
|
||||||
|
|
Reference in New Issue