Replace deprecated functions (#4)

* Replace deprecated functions

* add min_minetest_version
This commit is contained in:
Niklp 2022-06-18 21:15:23 +02:00 committed by GitHub
parent b65b6473c7
commit bbde71805a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -1,5 +0,0 @@
default
wool
minetest_systemd?
areas?
player_monoids?

View File

@ -218,7 +218,7 @@ minetest.register_entity("hangglider:glider", {
if self.object:get_attach() then if self.object:get_attach() then
local player = self.object:get_attach("parent") local player = self.object:get_attach("parent")
if player then if player then
local pos = player:getpos() local pos = player:get_pos()
local pname = player:get_player_name() local pname = player:get_player_name()
if hangglider.use[pname] then if hangglider.use[pname] then
local mrn_name = minetest.registered_nodes[minetest.get_node(vector.new(pos.x, pos.y-0.5, pos.z)).name] local mrn_name = minetest.registered_nodes[minetest.get_node(vector.new(pos.x, pos.y-0.5, pos.z)).name]
@ -227,7 +227,7 @@ minetest.register_entity("hangglider:glider", {
canExist = true canExist = true
if not minetestd then if not minetestd then
step_v = player:get_player_velocity().y step_v = player:get_velocity().y
if step_v < 0 and step_v > -3 then if step_v < 0 and step_v > -3 then
apply_physics_override(player, {speed=math.abs(step_v/2) + 0.75}) apply_physics_override(player, {speed=math.abs(step_v/2) + 0.75})
elseif step_v <= -3 then --Cap our gliding movement speed. elseif step_v <= -3 then --Cap our gliding movement speed.

View File

@ -1 +1,4 @@
name = hangglider name = hangglider
depends = default, wool
optional_depends = minetest_systemd, areas, player_monoids
min_minetest_version = 5.0