From 4d33f5f034408197bfb25292d2eef2b95403ff32 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sat, 10 Jun 2023 16:49:15 +0200 Subject: [PATCH] Improve the behaviour --- basis/fly_lib.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/basis/fly_lib.lua b/basis/fly_lib.lua index 6560b7f..090bb28 100644 --- a/basis/fly_lib.lua +++ b/basis/fly_lib.lua @@ -516,7 +516,8 @@ minetest.register_entity("techage:move_item", { self.old_dist = self.old_dist or dist if self.lmove and self.lmove[self.path_idx] then - if dist < 1 or dist > self.old_dist then + local min_dist = math.min(1, self.max_speed / 8) + if dist < min_dist or dist > self.old_dist then -- change of direction local next_pos = stop_obj(obj, self) if not moveon_entity(obj, self, next_pos) then @@ -565,7 +566,7 @@ local function is_simple_node(pos) local node = techage.get_node_lvm(pos) if not minecart.is_rail(pos, node.name) then local ndef = minetest.registered_nodes[node.name] - return not techage.is_air_like(node.name) and techage.can_dig_node(node.name, ndef) or minecart.is_cart(node.name) + return node.name ~= "air" and techage.can_dig_node(node.name, ndef) or minecart.is_cart(node.name) end end