summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Zhang <azhang9@gmail.com>2012-01-21 15:19:43 -0500
committerAnthony Zhang <azhang9@gmail.com>2012-01-21 15:20:36 -0500
commitc0eb0982aa65dc28abc49a2767b5a4abff96ddfe (patch)
treef9da98512e289787a8e7100d20cea7b05f6ad994
parentf221aeb06655e9753b4404737c95f505397c81aa (diff)
downloadmesecons-c0eb0982aa65dc28abc49a2767b5a4abff96ddfe.tar
mesecons-c0eb0982aa65dc28abc49a2767b5a4abff96ddfe.tar.gz
mesecons-c0eb0982aa65dc28abc49a2767b5a4abff96ddfe.tar.bz2
mesecons-c0eb0982aa65dc28abc49a2767b5a4abff96ddfe.tar.xz
mesecons-c0eb0982aa65dc28abc49a2767b5a4abff96ddfe.zip
Fix a bug in which the wrong node was being checked for.
-rw-r--r--jeija/temperest.lua46
1 files changed, 23 insertions, 23 deletions
diff --git a/jeija/temperest.lua b/jeija/temperest.lua
index 8bd9507..d54da73 100644
--- a/jeija/temperest.lua
+++ b/jeija/temperest.lua
@@ -16,16 +16,16 @@ minetest.register_node("jeija:mesecon_plug", {
mesecon:register_on_signal_on(function(pos, node)
if node.name=="jeija:mesecon_plug" then
local set_node_on = function(pos)
- node = minetest.env:get_node(pos)
- if node.name=="jeija:mesecon_socket_off" then
- minetest.env:add_node(pos, {name="jeija:mesecon_socket_on"})
- nodeupdate(pos)
- mesecon:receptor_on(pos)
- elseif node.name=="jeija:mesecon_inverter_on" then
- minetest.env:add_node(pos, {name="jeija:mesecon_inverter_off"})
- nodeupdate(pos)
- mesecon:receptor_off(pos)
- end
+ node = minetest.env:get_node(pos)
+ if node.name=="jeija:mesecon_socket_off" then
+ minetest.env:add_node(pos, {name="jeija:mesecon_socket_on"})
+ nodeupdate(pos)
+ mesecon:receptor_on(pos)
+ elseif node.name=="jeija:mesecon_inverter_on" then
+ minetest.env:add_node(pos, {name="jeija:mesecon_inverter_off"})
+ nodeupdate(pos)
+ mesecon:receptor_off(pos)
+ end
end
lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
@@ -38,23 +38,23 @@ mesecon:register_on_signal_on(function(pos, node)
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z-2}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
- if lnode.name=="air" then set_node_on({x=pos.x-2, y=pos.y, z=pos.z+2}) end
+ if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z+2}) end
end
end)
mesecon:register_on_signal_off(function(pos, node)
if node.name=="jeija:mesecon_plug" then
local set_node_off = function(pos)
- node = minetest.env:get_node(pos)
- if node.name=="jeija:mesecon_socket_on" then
- minetest.env:add_node(pos, {name="jeija:mesecon_socket_off"})
- nodeupdate(pos)
- mesecon:receptor_off(pos)
- elseif node.name=="jeija:mesecon_inverter_off" then
- minetest.env:add_node(pos, {name="jeija:mesecon_inverter_on"})
- nodeupdate(pos)
- mesecon:receptor_on(pos)
- end
+ node = minetest.env:get_node(pos)
+ if node.name=="jeija:mesecon_socket_on" then
+ minetest.env:add_node(pos, {name="jeija:mesecon_socket_off"})
+ nodeupdate(pos)
+ mesecon:receptor_off(pos)
+ elseif node.name=="jeija:mesecon_inverter_off" then
+ minetest.env:add_node(pos, {name="jeija:mesecon_inverter_on"})
+ nodeupdate(pos)
+ mesecon:receptor_on(pos)
+ end
end
lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
@@ -67,7 +67,7 @@ mesecon:register_on_signal_off(function(pos, node)
if lnode.name=="air" then set_node_off({x=pos.x, y=pos.y, z=pos.z-2}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
- if lnode.name=="air" then set_node_off({x=pos.x-2, y=pos.y, z=pos.z+2}) end
+ if lnode.name=="air" then set_node_off({x=pos.x, y=pos.y, z=pos.z+2}) end
end
end)
@@ -96,7 +96,7 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
if lnode.name=="air" then set_node_deactivated({x=pos.x, y=pos.y, z=pos.z-2}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
- if lnode.name=="air" then set_node_deactivated({x=pos.x-2, y=pos.y, z=pos.z+2}) end
+ if lnode.name=="air" then set_node_deactivated({x=pos.x, y=pos.y, z=pos.z+2}) end
end
end)