diff options
author | Jeija <norrepli@gmail.com> | 2012-12-16 16:29:03 +0100 |
---|---|---|
committer | Jeija <norrepli@gmail.com> | 2012-12-16 16:29:03 +0100 |
commit | 2c4a46a5572e9f633faba97a52d2245d17930db4 (patch) | |
tree | 71a8b2e23ff61f446f37d9097d0043da09cfc16a | |
parent | c76c274cc01c1c3b04c247604d7c0c933ab4e7a6 (diff) | |
download | mesecons-2c4a46a5572e9f633faba97a52d2245d17930db4.tar mesecons-2c4a46a5572e9f633faba97a52d2245d17930db4.tar.gz mesecons-2c4a46a5572e9f633faba97a52d2245d17930db4.tar.bz2 mesecons-2c4a46a5572e9f633faba97a52d2245d17930db4.tar.xz mesecons-2c4a46a5572e9f633faba97a52d2245d17930db4.zip |
Minor cleanup, use addPosRule
-rw-r--r-- | mesecons/init.lua | 10 |
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 |