From ecfb31d16670790310e7a961f342b2bcd6b086e2 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sun, 15 Aug 2021 14:25:01 -0300 Subject: [PATCH] correcao do tug --- airutils_papi.lua | 18 ++++++++++++++++++ airutils_tug.lua | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/airutils_papi.lua b/airutils_papi.lua index 214b6ae..14572a2 100644 --- a/airutils_papi.lua +++ b/airutils_papi.lua @@ -93,6 +93,24 @@ minetest.register_node("airutils:papi",{ end, }) +function airutils.remove_papi(pos) + local meta = core.get_meta(pos) + local node = minetest.get_node(pos) + local dir=node.param2 + if node.name == "airutils:papi_right" then + core.set_node(pos, {name="airutils:papi", param2=dir}) + meta:set_string("infotext", "PAPI - left side\rOwned by: "..player_name) + end + + meta:set_string("owner", player_name) + meta:set_string("dont_destroy", "false") + + if meta:get_string("dont_destroy") == "true" then + -- when swapping it + return + end +end + -- PAPI right node minetest.register_node("airutils:papi_right",{ description = "PAPI_right_side", diff --git a/airutils_tug.lua b/airutils_tug.lua index f9f1234..fc399c8 100644 --- a/airutils_tug.lua +++ b/airutils_tug.lua @@ -20,8 +20,10 @@ function airutils.move_target(player, pointed_thing) if player:get_player_control().sneak == true then local rotation = object:get_rotation() - rotation.y = yaw + math.rad(180) - object:set_rotation(rotation) + if rotation then + rotation.y = yaw + math.rad(180) + object:set_rotation(rotation) + end else if is_airlike then object:set_pos(obj_pos) end end