1
0
Fork 0

playerplus: fix deprc. add_player_velocity calls

mobs_head_rotation
cora 2022-05-12 15:34:14 +02:00 committed by Gitea
parent 729159f631
commit a1209b14a1
1 changed files with 2 additions and 4 deletions

View File

@ -242,8 +242,7 @@ minetest.register_globalstep(function(dtime)
local c_x, c_y = unpack(player_collision(player)) local c_x, c_y = unpack(player_collision(player))
if player_velocity.x + player_velocity.y < .5 and c_x + c_y > 0 then 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 player:add_velocity({x = c_x, y = 0, z = c_y})
add_velocity(player, {x = c_x, y = 0, z = c_y})
player_velocity = player:get_velocity() or player:get_player_velocity() player_velocity = player:get_velocity() or player:get_player_velocity()
end end
@ -286,8 +285,7 @@ minetest.register_globalstep(function(dtime)
if elytra.rocketing > 0 then if elytra.rocketing > 0 then
elytra.rocketing = elytra.rocketing - dtime elytra.rocketing = elytra.rocketing - dtime
if vector.length(player_velocity) < 40 then if vector.length(player_velocity) < 40 then
local add_velocity = player.add_velocity or player.add_player_velocity player:add_velocity(vector.multiply(player:get_look_dir(), 4))
add_velocity(player, vector.multiply(player:get_look_dir(), 4))
add_particle({ add_particle({
pos = fly_pos, pos = fly_pos,
velocity = {x = 0, y = 0, z = 0}, velocity = {x = 0, y = 0, z = 0},