forked from Mirrorlandia_minetest/mesecons
Replace deprecated getpos() calls (#522)
This commit is contained in:
parent
de4eeebd3b
commit
01332a7ba1
@ -110,7 +110,7 @@ local function resolve_commands(commands, pos)
|
|||||||
local nearest, farthest = nil, nil
|
local nearest, farthest = nil, nil
|
||||||
local min_distance, max_distance = math.huge, -1
|
local min_distance, max_distance = math.huge, -1
|
||||||
for index, player in pairs(players) do
|
for index, player in pairs(players) do
|
||||||
local distance = vector.distance(pos, player:getpos())
|
local distance = vector.distance(pos, player:get_pos())
|
||||||
if distance < min_distance then
|
if distance < min_distance then
|
||||||
min_distance = distance
|
min_distance = distance
|
||||||
nearest = player:get_player_name()
|
nearest = player:get_player_name()
|
||||||
|
@ -239,7 +239,7 @@ local node_detector_digiline = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
local function after_place_node_detector(pos, placer)
|
local function after_place_node_detector(pos, placer)
|
||||||
local placer_pos = placer:getpos()
|
local placer_pos = placer:get_pos()
|
||||||
if not placer_pos then
|
if not placer_pos then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -24,7 +24,7 @@ local function pp_on_timer(pos, elapsed)
|
|||||||
mesecon.receptor_off(pos, mesecon.rules.pplate)
|
mesecon.receptor_off(pos, mesecon.rules.pplate)
|
||||||
elseif node.name == basename .. "_off" then
|
elseif node.name == basename .. "_off" then
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
local objpos = obj:getpos()
|
local objpos = obj:get_pos()
|
||||||
if objpos.y > pos.y-1 and objpos.y < pos.y then
|
if objpos.y > pos.y-1 and objpos.y < pos.y then
|
||||||
minetest.set_node(pos, {name = basename .. "_on"})
|
minetest.set_node(pos, {name = basename .. "_on"})
|
||||||
mesecon.receptor_on(pos, mesecon.rules.pplate )
|
mesecon.receptor_on(pos, mesecon.rules.pplate )
|
||||||
|
Loading…
Reference in New Issue
Block a user