From c95e3e7b50dd11abe55a04654483f128803ff302 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 5 Feb 2023 19:34:08 +0100 Subject: [PATCH] Accept mincart carts for the move controller --- basis/fly_lib.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/basis/fly_lib.lua b/basis/fly_lib.lua index a9a8831..f50ea6a 100644 --- a/basis/fly_lib.lua +++ b/basis/fly_lib.lua @@ -50,7 +50,7 @@ local function set_node(item, playername) nvm.running = false M(item.base_pos):set_string("status", S("Stopped")) if ndef1 and ndef2 then - if minecart.is_cart(name) then + if minecart.is_cart(name) and minecart.is_rail(dest_pos, node.name) then local player = playername and minetest.get_player_by_name(playername) minecart.place_and_start_cart(dest_pos, {name = name, param2 = param2}, item.cartdef, player) return @@ -548,6 +548,9 @@ local function is_valid_dest(pos) if techage.is_air_like(node.name) then return true end + if minecart.is_rail(pos, node.name) then + return true + end if not M(pos):contains("ta_move_block") then return true end @@ -556,7 +559,7 @@ end local function is_simple_node(pos) local node = techage.get_node_lvm(pos) - if not minecart.is_rail(pos, node) then + 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) end @@ -580,7 +583,7 @@ local function move_node(pos, meta, pos1, lmove, max_speed, height) if obj then if is_cart then - attach_objects(pos1, 0, obj, yoffs, {x = 0, y = -0.2, z = 0}) + attach_objects(pos1, 0, obj, yoffs, {x = 0, y = -0.4, z = 0}) else local offs = {x=0, y=height or 1, z=0} attach_objects(pos1, offs, obj, yoffs)