diff options
author | cheapie <no-email-for-you@example.com> | 2017-01-11 01:04:47 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2017-01-11 01:04:47 -0600 |
commit | 2132f8ecb6afcb94195f528b90794b4e5c200fb6 (patch) | |
tree | 1ba50ad595595ef1fdb3034cc3ff60537cbde043 | |
parent | 26c80f7ea0d7c2f37ed367dd67fd19bb5e0d92a1 (diff) | |
download | ltc4000e-2132f8ecb6afcb94195f528b90794b4e5c200fb6.tar ltc4000e-2132f8ecb6afcb94195f528b90794b4e5c200fb6.tar.gz ltc4000e-2132f8ecb6afcb94195f528b90794b4e5c200fb6.tar.bz2 ltc4000e-2132f8ecb6afcb94195f528b90794b4e5c200fb6.tar.xz ltc4000e-2132f8ecb6afcb94195f528b90794b4e5c200fb6.zip |
Restart timers on block load
-rw-r--r-- | init.lua | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -343,3 +343,21 @@ minetest.register_node("ltc4000e:controller", { }, }, }) + +--Make sure lights don't "stall" if unloaded +minetest.register_lbm({ + label = "Restart LTC-4000E timers", + name = "ltc4000e:restart_timers", + nodenames = {"ltc4000e:controller"}, + run_at_every_load = true, + action = function(pos) + local meta = minetest.get_meta(pos) + local mem = minetest.deserialize(meta:get_string("mem")) + if mem.cycle then + local event = {} + event.type = "interrupt" + event.iid = "tick" + run(pos,event) + end + end +}) |