summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2016-09-04 09:50:30 +0200
committerJeija <norrepli@gmail.com>2016-09-04 09:50:30 +0200
commit95fedc88bcf11eb5c5e42afe397c74e57819c8c9 (patch)
treeee636e865731277cbced6f1b0c32cca98f31bb54
parent433778c2ec8ec38bc2aad04c262d56a90952c276 (diff)
downloadmesecons-95fedc88bcf11eb5c5e42afe397c74e57819c8c9.tar
mesecons-95fedc88bcf11eb5c5e42afe397c74e57819c8c9.tar.gz
mesecons-95fedc88bcf11eb5c5e42afe397c74e57819c8c9.tar.bz2
mesecons-95fedc88bcf11eb5c5e42afe397c74e57819c8c9.tar.xz
mesecons-95fedc88bcf11eb5c5e42afe397c74e57819c8c9.zip
Never postpone action_on or action_off
There is no more need for that since VoxelManip caching makes sure we always get an answer to get_node_force.
-rw-r--r--mesecons/init.lua22
1 files changed, 2 insertions, 20 deletions
diff --git a/mesecons/init.lua b/mesecons/init.lua
index 39b4fd3..83e611b 100644
--- a/mesecons/init.lua
+++ b/mesecons/init.lua
@@ -74,17 +74,7 @@ mesecon.queue:add_function("receptor_on", function (pos, rules)
rules = rules or mesecon.rules.default
- -- if area (any of the rule targets) is not loaded, keep trying and call this again later
- for _, rule in ipairs(mesecon.flattenrules(rules)) do
- local np = vector.add(pos, rule)
- -- if area is not loaded, keep trying
- if minetest.get_node_or_nil(np) == nil then
- mesecon.queue:add_action(pos, "receptor_on", {rules}, nil, rules)
- return
- end
- end
-
- -- execute action
+ -- Call turnon on all linking positions
for _, rule in ipairs(mesecon.flattenrules(rules)) do
local np = vector.add(pos, rule)
local rulenames = mesecon.rules_link_rule_all(pos, rule)
@@ -103,15 +93,7 @@ end
mesecon.queue:add_function("receptor_off", function (pos, rules)
rules = rules or mesecon.rules.default
- -- if area (any of the rule targets) is not loaded, keep trying and call this again later
- for _, rule in ipairs(mesecon.flattenrules(rules)) do
- local np = vector.add(pos, rule)
- if minetest.get_node_or_nil(np) == nil then
- mesecon.queue:add_action(pos, "receptor_off", {rules}, nil, rules)
- return
- end
- end
-
+ -- Call turnoff on all linking positions
for _, rule in ipairs(mesecon.flattenrules(rules)) do
local np = vector.add(pos, rule)
local rulenames = mesecon.rules_link_rule_all(pos, rule)