setpos replaced by set_pos

This commit is contained in:
Joachim Stolberg 2018-04-16 19:13:16 +02:00
parent 7e23b7bf50
commit 8145bf4926

@ -163,7 +163,7 @@ local function control_player(pos, pos1, pos2, player_name)
if correction == true then if correction == true then
local last_pos = minetest.string_to_pos(meta:get_string("last_known_pos")) local last_pos = minetest.string_to_pos(meta:get_string("last_known_pos"))
if last_pos then if last_pos then
player:setpos(last_pos) player:set_pos(last_pos)
end end
else -- store last known correct position else -- store last known correct position
meta:set_string("last_known_pos", minetest.pos_to_string(pl_pos)) meta:set_string("last_known_pos", minetest.pos_to_string(pl_pos))
@ -194,7 +194,7 @@ local function place_hook(pos, dir, player, pos1, pos2)
pos.y = pos.y - 1 pos.y = pos.y - 1
pos.x = pos.x + dir.x pos.x = pos.x + dir.x
pos.z = pos.z + dir.z pos.z = pos.z + dir.z
player:setpos(pos) player:set_pos(pos)
meta:set_string("last_known_pos", minetest.pos_to_string(pos)) meta:set_string("last_known_pos", minetest.pos_to_string(pos))
-- control player every second -- control player every second
minetest.after(1, control_player, switch_pos, pos1, pos2, player:get_player_name()) minetest.after(1, control_player, switch_pos, pos1, pos2, player:get_player_name())