From 30c7525103f9d8aa2b5e6746b01d312f598aad4b Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Wed, 10 Jan 2024 09:20:16 -0300 Subject: [PATCH] fix server crash https://github.com/APercy/airutils/issues/10 --- airutils_tug.lua | 1 + 1 file changed, 1 insertion(+) 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