diff --git a/airutils_tug.lua b/airutils_tug.lua index 8830196..9ae359c 100644 --- a/airutils_tug.lua +++ b/airutils_tug.lua @@ -8,6 +8,7 @@ function airutils.move_target(player, pointed_thing) --minetest.chat_send_all(dump(object)) if object then local obj_pos = object:get_pos() + if not obj_pos then return end local hip = math.sqrt(math.pow(obj_pos.x - pos.x,2)+math.pow(obj_pos.z - pos.z,2)) + 1 local pos_x = math.sin(yaw) * -hip local pos_z = math.cos(yaw) * hip