summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYutao Yuan <yyt16384@gmail.com>2016-12-04 19:37:31 +0800
committerYutao Yuan <yyt16384@gmail.com>2016-12-04 19:37:31 +0800
commit67cd17aa799dd4d168e95f2c3ea80076371da26e (patch)
tree8ad4dd5ee5d64b125b7f1df9c56e601f8bbd6aa2
parent203aaf3c90d7397210f429f008b836920794d07d (diff)
downloadmesecons-67cd17aa799dd4d168e95f2c3ea80076371da26e.tar
mesecons-67cd17aa799dd4d168e95f2c3ea80076371da26e.tar.gz
mesecons-67cd17aa799dd4d168e95f2c3ea80076371da26e.tar.bz2
mesecons-67cd17aa799dd4d168e95f2c3ea80076371da26e.tar.xz
mesecons-67cd17aa799dd4d168e95f2c3ea80076371da26e.zip
Fix crash with movestones
-rw-r--r--mesecons_movestones/init.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesecons_movestones/init.lua b/mesecons_movestones/init.lua
index 52a5605..9e9dce6 100644
--- a/mesecons_movestones/init.lua
+++ b/mesecons_movestones/init.lua
@@ -26,28 +26,28 @@ function mesecon.get_movestone_direction(pos)
lpos = {x=pos.x+1, y=pos.y, z=pos.z}
for n = 1, 3 do
- if mesecon.is_power_on(lpos, rules[n].x, rules[n].y, rules[n].z) then
+ if mesecon.is_power_on(lpos, rules[n]) then
return {x=0, y=0, z=-1}
end
end
lpos = {x = pos.x-1, y = pos.y, z = pos.z}
for n=4, 6 do
- if mesecon.is_power_on(lpos, rules[n].x, rules[n].y, rules[n].z) then
+ if mesecon.is_power_on(lpos, rules[n]) then
return {x=0, y=0, z=1}
end
end
lpos = {x = pos.x, y = pos.y, z = pos.z+1}
for n=7, 9 do
- if mesecon.is_power_on(lpos, rules[n].x, rules[n].y, rules[n].z) then
+ if mesecon.is_power_on(lpos, rules[n]) then
return {x=-1, y=0, z=0}
end
end
lpos = {x = pos.x, y = pos.y, z = pos.z-1}
for n=10, 12 do
- if mesecon.is_power_on(lpos, rules[n].x, rules[n].y, rules[n].z) then
+ if mesecon.is_power_on(lpos, rules[n]) then
return {x=1, y=0, z=0}
end
end