forked from VoxeLibre/mcl_cozy
Change function call of set_physics_override to a more modern syntax so we dont get the deprecation warnings.
This commit is contained in:
parent
ad33e6bc1e
commit
b39deed14d
12
init.lua
12
init.lua
|
@ -41,14 +41,14 @@ minetest.register_globalstep(function(dtime)
|
|||
players[i]:get_player_control().jump == true or
|
||||
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)
|
||||
players[i]:set_physics_override({speed=1, jump=1, gravity=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_physics_override(1, 1, 1)
|
||||
players[i]:set_physics_override({speed=1, jump=1, gravity=1})
|
||||
mcl_player.player_attached[name] = false
|
||||
end
|
||||
end
|
||||
|
@ -62,13 +62,13 @@ minetest.register_chatcommand("sit", {
|
|||
if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end
|
||||
if mcl_player.player_attached[name] then
|
||||
player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
|
||||
player:set_physics_override(1, 1, 1)
|
||||
player:set_physics_override({speed=1, jump=1, gravity=1})
|
||||
mcl_player.player_attached[name] = false
|
||||
mcl_player.player_set_animation(player, "stand", 30)
|
||||
print_action_stand(name)
|
||||
else
|
||||
player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0})
|
||||
player:set_physics_override(0, 0, 0)
|
||||
player:set_physics_override({speed=0, jump=0, gravity=0})
|
||||
mcl_player.player_attached[name] = true
|
||||
mcl_player.player_set_animation(player, "sit", 30)
|
||||
print_action_sit(name)
|
||||
|
@ -84,13 +84,13 @@ minetest.register_chatcommand("lay", {
|
|||
if minetest.get_node(vector.offset(player:get_pos(),0,-1,0)).name == "air" then return end
|
||||
if mcl_player.player_attached[name] then
|
||||
player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
|
||||
player:set_physics_override(1, 1, 1)
|
||||
player:set_physics_override({speed=1, jump=1, gravity=1})
|
||||
mcl_player.player_attached[name] = false
|
||||
mcl_player.player_set_animation(player, "stand", 30)
|
||||
print_action_stand(name)
|
||||
else
|
||||
player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0})
|
||||
player:set_physics_override(0, 0, 0)
|
||||
player:set_physics_override({speed=0, jump=0, gravity=0})
|
||||
mcl_player.player_attached[name] = true
|
||||
mcl_player.player_set_animation(player, "lay", 0)
|
||||
print_action_lay(name)
|
||||
|
|
Loading…
Reference in New Issue