From 300abcb5877d948e6a68be454ed46b65a0f90f01 Mon Sep 17 00:00:00 2001 From: Jeija Date: Sun, 20 Apr 2014 21:44:58 +0200 Subject: Fix #155 (option 2 used). Remove non-ActionQueue system. Enable overheat for more than 20 actions per second on lua- / microcontrollers and gates. Fix a bug where a burnt luacontroller didn't have the correct pin-states as the burnt controller does not register any changes from outside. --- mesecons_gates/init.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'mesecons_gates') diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua index 51ed4af..a22edf6 100644 --- a/mesecons_gates/init.lua +++ b/mesecons_gates/init.lua @@ -47,9 +47,7 @@ function set_gate(pos, on) gate = get_gate(pos) local meta = minetest.get_meta(pos) if on ~= gate_state(pos) then - yc_heat(meta) - --minetest.after(0.5, yc_cool, meta) - if yc_overheat(meta) then + if mesecon.do_overheat(pos) then pop_gate(pos) else local node = minetest.get_node(pos) @@ -78,7 +76,9 @@ end function pop_gate(pos) gate = get_gate(pos) minetest.remove_node(pos) - minetest.after(0.2, yc_overheat_off, pos) + minetest.after(0.2, function (pos) + mesecon:receptor_off(pos, mesecon.rules.flat) + end , pos) -- wait for pending parsings minetest.add_item(pos, "mesecons_gates:"..gate.."_off") end @@ -153,7 +153,6 @@ for _, gate in ipairs(gates) do walkable = true, on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_int("heat", 0) update_gate(pos) end, groups = groups, @@ -221,4 +220,3 @@ minetest.register_craft({ {'mesecons:mesecon', '', ''}, }, }) - -- cgit v1.2.3