summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesecons/init.lua10
1 files changed, 2 insertions, 8 deletions
diff --git a/mesecons/init.lua b/mesecons/init.lua
index 0af53f1..900d4bb 100644
--- a/mesecons/init.lua
+++ b/mesecons/init.lua
@@ -79,10 +79,7 @@ function mesecon:receptor_on(pos, rules)
rules = rules or mesecon.rules.default
for _, rule in ipairs(rules) do
- local np = {
- x = pos.x + rule.x,
- y = pos.y + rule.y,
- z = pos.z + rule.z}
+ local np = mesecon:addPosRule(pos, rule)
if mesecon:rules_link(pos, np, rules) then
mesecon:turnon(np, pos)
end
@@ -93,10 +90,7 @@ function mesecon:receptor_off(pos, rules)
rules = rules or mesecon.rules.default
for _, rule in ipairs(rules) do
- local np = {
- x = pos.x + rule.x,
- y = pos.y + rule.y,
- z = pos.z + rule.z}
+ local np = mesecon:addPosRule(pos, rule)
if mesecon:rules_link(pos, np, rules) and not mesecon:connected_to_receptor(np) then
mesecon:turnoff(np, pos)
end