Replace deprecated function calls

This commit is contained in:
Wuzzy 2023-03-12 16:25:09 +01:00
parent 31e522dcb2
commit 3f568c0d5b

View File

@ -25,7 +25,7 @@ end
function teletool.teleport(player, pointed_thing)
local pos = pointed_thing.above
local src = player:getpos()
local src = player:get_pos()
local dest = {x=pos.x, y=math.ceil(pos.y)-0.5, z=pos.z}
local over = {x=dest.x, y=dest.y+1, z=dest.z}
local destnode = minetest.get_node({x=dest.x, y=math.ceil(dest.y), z=dest.z})
@ -62,7 +62,7 @@ function teletool.teleport(player, pointed_thing)
})
minetest.sound_play( {name="teletool_teleport1", gain=1}, {pos=src, max_hear_distance=12}, true)
player:setpos(dest)
player:set_pos(dest)
minetest.add_particlespawner({
amount = 25,
time = 0.1,
@ -104,7 +104,7 @@ minetest.register_tool("teletool:teletool_infinite", {
failure = true
end
if failure then
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, true)
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:get_pos(), max_hear_distance=4}, true)
end
return itemstack
end,
@ -148,7 +148,7 @@ if(minetest.get_modpath("technic")) then
failure = true
end
if failure then
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, true)
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:get_pos(), max_hear_distance=4}, true)
end
return itemstack
end,
@ -189,7 +189,7 @@ if(minetest.get_modpath("mana") ~= nil) then
failure = true
end
if failure then
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:getpos(), max_hear_distance=4}, true)
minetest.sound_play( {name="teletool_fail", gain=0.5}, {pos=user:get_pos(), max_hear_distance=4}, true)
end
return itemstack
end,