From 223a43204bc392abd7e3fec9d1b1a9e6990e9180 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Sun, 25 Apr 2021 18:02:10 +0200 Subject: [PATCH] Fix cart detector bug --- logic/cart_detector.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/logic/cart_detector.lua b/logic/cart_detector.lua index 8fae87a..4457374 100644 --- a/logic/cart_detector.lua +++ b/logic/cart_detector.lua @@ -21,8 +21,11 @@ local logic = techage.logic local CYCLE_TIME = 2 local function switch_off(pos) - logic.swap_node(pos, "techage:ta3_cartdetector_off") - logic.send_off(pos, M(pos)) + local node = minetest.get_node(pos) + if node.name == "techage:ta3_cartdetector_on" then + logic.swap_node(pos, "techage:ta3_cartdetector_off") + logic.send_off(pos, M(pos)) + end end local function switch_on(pos)