Skip to content

Commit

Permalink
avoid depricated get_player_velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
SwissalpS authored Apr 10, 2024
1 parent 3d1c7f1 commit 49e6902
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ minetest.register_tool("glider:glider", {
luaent.driver = name
local rot = { y = user:get_look_horizontal(), x = -user:get_look_vertical(), z = 0 }
ent:set_rotation(rot)
local vel = vector.multiply(user:get_player_velocity(), 2)
local vel = vector.multiply(user:get_velocity(), 2)
ent:set_velocity(vel)
luaent.speed = math.sqrt(vel.x ^ 2 + (vel.y * 0.25) ^ 2 + vel.z ^ 2)
user:set_attach(ent, "", { x = 0, y = 0, z = -10 }, { x = 90, y = 0, z = 0 })
Expand Down

0 comments on commit 49e6902

Please sign in to comment.