diff options
author | cheapie <no-email-for-you@example.com> | 2017-01-13 00:53:26 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2017-01-13 00:53:26 -0600 |
commit | 2dd4db0c890292a8304d37ac730a60033ded0f67 (patch) | |
tree | beb716aed1eb73e48c66c4057f0e6dfccf0e20c4 | |
parent | 09ce968d579f24eb86e07c929f33511472909ab0 (diff) | |
download | ltc4000e-2dd4db0c890292a8304d37ac730a60033ded0f67.tar ltc4000e-2dd4db0c890292a8304d37ac730a60033ded0f67.tar.gz ltc4000e-2dd4db0c890292a8304d37ac730a60033ded0f67.tar.bz2 ltc4000e-2dd4db0c890292a8304d37ac730a60033ded0f67.tar.xz ltc4000e-2dd4db0c890292a8304d37ac730a60033ded0f67.zip |
Fix crash when two controllers are connected
-rw-r--r-- | fw.lua | 10 | ||||
-rw-r--r-- | init.lua | 2 |
2 files changed, 11 insertions, 1 deletions
@@ -15,6 +15,16 @@ modes = {"Sensor","Timer","Phase Lock"} panellock = {"Unlocked","Locked"} logmodes = {"Quiet","Normal","Verbose"} +--Only accept digilines signals on the necessary channels +local event_ok = false +if event.type ~= "digiline" then event_ok = true end +if (not event_ok) and (string.find(event.channel,"detector") or string.find(event.channel,"preempt")) then event_ok = true end +if (not event_ok) and (event.channel == "touchscreen") then event_ok = true end +if not event_ok then + --Digilines signal on unimportant channel, stop execution + return +end + --Used for reverse lookups function pivot(table) local out = {} @@ -528,7 +528,7 @@ minetest.register_lbm({ action = function(pos) local meta = minetest.get_meta(pos) local mem = minetest.deserialize(meta:get_string("mem")) - if mem.cycle then + if mem and mem.cycle then local event = {} event.type = "interrupt" event.iid = "tick" |