mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Fix #1572
This commit is contained in:
parent
fc9928c0b6
commit
5d9c3cd85b
1 changed files with 8 additions and 7 deletions
|
@ -150,13 +150,6 @@ minetest.register_globalstep(function(dtime)
|
|||
|
||||
for _,player in pairs(get_connected_players()) do
|
||||
|
||||
local c_x, c_y = unpack(player_collision(player))
|
||||
|
||||
if player:get_velocity().x + player:get_velocity().y < .5 and c_x + c_y > 0 then
|
||||
--minetest.chat_send_player(player:get_player_name(), "pushed at " .. c_x + c_y .. " parsecs.")
|
||||
player:add_velocity({x=c_x, y=0, z=c_y})
|
||||
end
|
||||
|
||||
--[[
|
||||
_ _ _
|
||||
__ _ _ __ (_)_ __ ___ __ _| |_(_) ___ _ __ ___
|
||||
|
@ -173,6 +166,14 @@ minetest.register_globalstep(function(dtime)
|
|||
local wielded = player:get_wielded_item()
|
||||
local player_velocity = player:get_velocity() or player:get_player_velocity()
|
||||
|
||||
local c_x, c_y = unpack(player_collision(player))
|
||||
|
||||
if player_velocity.x + player_velocity.y < .5 and c_x + c_y > 0 then
|
||||
local add_velocity = player.add_player_velocity or player.add_velocity
|
||||
add_velocity(player, {x = c_x, y = 0, z = c_y})
|
||||
player_velocity = player:get_velocity() or player:get_player_velocity()
|
||||
end
|
||||
|
||||
-- control head bone
|
||||
local pitch = - degrees(player:get_look_vertical())
|
||||
local yaw = degrees(player:get_look_horizontal())
|
||||
|
|
Loading…
Reference in a new issue