From 54ed4e60c5864b779722a74bf6f452e1abaa363a Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Fri, 6 May 2022 23:02:22 +0200 Subject: [PATCH] Fix wind turbine and concentrator bugs --- basic_machines/concentrator.lua | 8 ++++++++ wind_turbine/rotor.lua | 3 +++ 2 files changed, 11 insertions(+) diff --git a/basic_machines/concentrator.lua b/basic_machines/concentrator.lua index cba0f58..b2a4d67 100644 --- a/basic_machines/concentrator.lua +++ b/basic_machines/concentrator.lua @@ -65,6 +65,10 @@ local names = networks.register_junction("techage:concentrator", 2/8, Boxes, Tub end, }, 27) +for _, name in ipairs(names) do + Tube:set_valid_sides(name, {"B", "R", "F", "L", "D", "U"}) +end + techage.register_node(names, { on_push_item = function(pos, in_dir, stack) local push_dir = M(pos):get_int("push_dir") @@ -110,6 +114,10 @@ names = networks.register_junction("techage:ta4_concentrator", 2/8, Boxes, Tube, end, }, 27) +for _, name in ipairs(names) do + Tube:set_valid_sides(name, {"B", "R", "F", "L", "D", "U"}) +end + techage.register_node(names, { on_push_item = function(pos, in_dir, stack) local push_dir = M(pos):get_int("push_dir") diff --git a/wind_turbine/rotor.lua b/wind_turbine/rotor.lua index 5be96d2..34670ea 100644 --- a/wind_turbine/rotor.lua +++ b/wind_turbine/rotor.lua @@ -117,9 +117,11 @@ local function stop_rotor(pos, nvm, state) end local function can_start(pos, nvm) + check_rotor(pos, nvm) if nvm.error then return nvm.error end + add_rotor(pos, nvm) return true end @@ -308,6 +310,7 @@ techage.register_node({"techage:ta4_wind_turbine"}, { on_node_load = function(pos) local nvm = techage.get_nvm(pos) add_rotor(pos, nvm, true) + start_rotor(pos, nvm) minetest.get_node_timer(pos):start(CYCLE_TIME) end, })