From f7043f4e10e5de3506f8084a87aa511b44eaf4b3 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Tue, 5 Mar 2019 18:38:41 +0100 Subject: [PATCH] bugfixes --- basis/node_states.lua | 2 +- basis/power.lua | 6 ++++-- electric/test.lua | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/basis/node_states.lua b/basis/node_states.lua index 2a2712e..2d7c89a 100644 --- a/basis/node_states.lua +++ b/basis/node_states.lua @@ -259,7 +259,7 @@ function NodeStates:blocked(pos, mem) end function NodeStates:fault(pos, mem) - if mem.techage_state == RUNNING then + if mem.techage_state == RUNNING or mem.techage_state == STOPPED then mem.techage_state = FAULT if self.node_name_passive then local node = minetest.get_node(pos) diff --git a/basis/power.lua b/basis/power.lua index 691d53b..02a9f59 100644 --- a/basis/power.lua +++ b/basis/power.lua @@ -125,8 +125,10 @@ local function check_power_consumption(pos, dir) local mem = tubelib2.get_mem(pos) Route = {} local sum = power_consumption(pos, dir) - Route = {} - turn_on(pos, nil, sum > 0) + if sum < 1 then + Route = {} + turn_on(pos, nil, false) + end end -- diff --git a/electric/test.lua b/electric/test.lua index f48415f..99b1686 100644 --- a/electric/test.lua +++ b/electric/test.lua @@ -20,7 +20,7 @@ end -- To be able to check if power connection is on the -- correct node side (mem.power_dir == in_dir) local function valid_power_dir(pos, mem, in_dir) - print("valid_power_dir", mem.power_dir, in_dir) + --print("valid_power_dir", mem.power_dir, in_dir) return true end