From 5fc526bb0f4feef1664085b5ab52f4fa2679e978 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 30 Aug 2024 14:24:47 -0500 Subject: Fix a few minor bugs --- fw.lua | 4 +++- init.lua | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fw.lua b/fw.lua index f15d082..039d45a 100644 --- a/fw.lua +++ b/fw.lua @@ -253,7 +253,7 @@ if event.type == "digiline" and string.sub(event.channel,1,8) == "preempt_" and end --Phase logic for already-running cycles -if mem.busy and event.type == "interrupt" and (event.iid == "tick" or event.iid == "manualtick") and not mem.phaselocked and (event.iid == "manualtick" or not mem.stoptime) then +if mem.busy and mem.cycle and event.type == "interrupt" and (event.iid == "tick" or event.iid == "manualtick") and not mem.phaselocked and (event.iid == "manualtick" or not mem.stoptime) then log("Continuing existing cycle at phase "..mem.cycle,true) if mem.cycle == "preempt_yellow" then for k,v in pairs(mem.currentphase) do @@ -802,6 +802,8 @@ if event.type == "digiline" and event.channel == "touchscreen" then interrupt(nil,"gapout") interrupt(nil,"maxgreen") end + elseif mem.menu == "reboot" then + --No fields/buttons on this screen, so do nothing else logfault("Unrecognized menu "..mem.menu,false) mem.menu = "run" diff --git a/init.lua b/init.lua index e95a537..672c344 100644 --- a/init.lua +++ b/init.lua @@ -785,11 +785,12 @@ minetest.register_node("ltc4000e:door_top", { sounds = default.node_sound_metal_defaults() }) ---Make sure lights don't "stall" if unloaded and not yet converted to node timers +--Make sure lights don't "stall" if unloaded and not yet converted to node timers, or if the timer stalled minetest.register_lbm({ label = "Restart LTC-4000E timers", name = "ltc4000e:restart_timers", nodenames = {"ltc4000e:polemount","ltc4000e:nema_bottom","ltc4000e:nema_bottom_open"}, + run_at_every_load = true, action = function(pos) local meta = minetest.get_meta(pos) local mem = minetest.deserialize(meta:get_string("mem")) -- cgit v1.2.3