From 45d0e334a7eea775f04b989dfa2c107447e29df2 Mon Sep 17 00:00:00 2001 From: Robbie Ferguson Date: Thu, 19 May 2016 22:36:57 -0400 Subject: [PATCH] Update init.lua --- init.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 1666e45..c14c688 100644 --- a/init.lua +++ b/init.lua @@ -41,12 +41,14 @@ local function find_air(pos,player) local top = {pos.x, pos.y+1, pos.z} local mid_node = minetest.get_node(mid) local top_node = minetest.get_node(top) + minetest.chat_send_player(player, "Start: " .. mid) + while mid_node.name ~= "air" or mid_node.name ~= "ignore" and top_node.name ~= "air" or top_node.name ~= "ignore" do pos.y = pos.y +2 mid_node = minetest.get_node(mid) top_node = minetest.get_node(top) end - minetest.chat_send_player(sender, "Result: " .. mid) + minetest.chat_send_player(player, "Result: " .. mid) return mid end @@ -251,17 +253,17 @@ local function tpj(player,param) local target_coords = minetest.get_player_by_name(player):getpos() if args[1] == "x" then target_coords["x"] = target_coords["x"] + tonumber(args[2]) - pname:setpos(find_air(find_free_position_near(target_coords))) + pname:setpos(find_air(find_free_position_near(target_coords),player)) minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10}) parti2(target_coords) elseif args[1] == "y" then target_coords["y"] = target_coords["y"] + tonumber(args[2]) - pname:setpos(find_air(find_free_position_near(target_coords))) + pname:setpos(find_air(find_free_position_near(target_coords),player)) minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10}) parti2(target_coords) elseif args[1] == "z" then target_coords["z"] = target_coords["z"] + tonumber(args[2]) - pname:setpos(find_air(find_free_position_near(target_coords))) + pname:setpos(find_air(find_free_position_near(target_coords),player)) minetest.sound_play("whoosh", {pos = target_coords, gain = 0.5, max_hear_distance = 10}) parti2(target_coords) else