Fix #952 and other occurences of get_player_velocity

This commit is contained in:
Elias Fleckenstein 2021-01-04 18:06:31 +01:00
parent aea051fe37
commit cfc86bcf3d
3 changed files with 12 additions and 12 deletions

View file

@ -313,7 +313,7 @@ local function xp_step(self, dtime)
pos = self.object:get_pos() pos = self.object:get_pos()
pos2 = collector:get_pos() pos2 = collector:get_pos()
player_velocity = collector:get_player_velocity() player_velocity = collector:get_velocity()
pos2.y = pos2.y + 0.8 pos2.y = pos2.y + 0.8

View file

@ -92,7 +92,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
-- FIXME: Velocity threshold should be 0.01 but Minetest 5.3.0 -- FIXME: Velocity threshold should be 0.01 but Minetest 5.3.0
-- sometimes reports incorrect Y speed. A velocity threshold -- sometimes reports incorrect Y speed. A velocity threshold
-- of 0.125 still seems good enough. -- of 0.125 still seems good enough.
if vector.length(player:get_player_velocity()) > 0.125 then if vector.length(player:get_velocity()) > 0.125 then
minetest.chat_send_player(name, S("You have to stop moving before going to bed!")) minetest.chat_send_player(name, S("You have to stop moving before going to bed!"))
return false return false
end end

View file

@ -156,7 +156,7 @@ function mcl_hunger.item_eat(hunger_change, replace_with_item, poisontime, poiso
-- Special item definition field: _food_particles -- Special item definition field: _food_particles
-- If false, force item to not spawn any food partiles when eaten -- If false, force item to not spawn any food partiles when eaten
if def._food_particles ~= false and texture and texture ~= "" then if def._food_particles ~= false and texture and texture ~= "" then
local v = user:get_player_velocity() local v = user:get_velocity()
local minvel = vector.add(v, {x=-1, y=1, z=-1}) local minvel = vector.add(v, {x=-1, y=1, z=-1})
local maxvel = vector.add(v, {x=1, y=2, z=1}) local maxvel = vector.add(v, {x=1, y=2, z=1})