Revert "Add more directions to check to the node behind a torch"

This reverts commit 9d218c95be.
master
PilzAdam 2013-05-29 00:45:30 +02:00
parent 9d218c95be
commit 12ea2489f2
1 changed files with 3 additions and 30 deletions

View File

@ -297,16 +297,7 @@ minetest.register_node("redstone:torch_on", {
local n = minetest.env:get_node(pos)
local m = minetest.env:get_meta(pos)
m:set_string("redstone_level", tostring(0))
local dir = get_wallmounted_dir(pos, n.param2)
dir.x, dir.y, dir.z = -dir.x, -dir.y, -dir.z
local tmp = redstone.default_rule
table.insert(tmp, {x=0,y=-1,z=0})
for i,rule in ipairs(tmp) do
if rule.x == tmp.x and rule.y == tmp.y and rule.z == tmp.z then
table.remove(tmp, i)
end
end
local level = redstone.level_at(get_wallmounted_node(pos, n.param2), tmp)
local level = redstone.level_at(get_wallmounted_node(pos, n.param2), {get_wallmounted_dir(pos, n.param2)})
m:set_string("redstone_level", tostring(16))
if level > 0 then
n.name = "redstone:torch_off"
@ -321,16 +312,7 @@ minetest.register_node("redstone:torch_on", {
end,
after_place_node = function(pos)
local n = minetest.env:get_node(pos)
local dir = get_wallmounted_dir(pos, n.param2)
dir.x, dir.y, dir.z = -dir.x, -dir.y, -dir.z
local tmp = redstone.default_rule
table.insert(tmp, {x=0,y=-1,z=0})
for i,rule in ipairs(tmp) do
if rule.x == tmp.x and rule.y == tmp.y and rule.z == tmp.z then
table.remove(tmp, i)
end
end
local level = redstone.level_at(get_wallmounted_node(pos, n.param2), tmp)
local level = redstone.level_at(get_wallmounted_node(pos, n.param2), {get_wallmounted_dir(pos, n.param2)})
if level > 0 then
n.name = "redstone:torch_off"
minetest.env:set_node(pos, n)
@ -374,16 +356,7 @@ minetest.register_node("redstone:torch_off", {
redstone_update = function(pos)
local n = minetest.env:get_node(pos)
local dir = get_wallmounted_dir(pos, n.param2)
dir.x, dir.y, dir.z = -dir.x, -dir.y, -dir.z
local tmp = redstone.default_rule
table.insert(tmp, {x=0,y=-1,z=0})
for i,rule in ipairs(tmp) do
if rule.x == tmp.x and rule.y == tmp.y and rule.z == tmp.z then
table.remove(tmp, i)
end
end
local level = redstone.level_at(get_wallmounted_node(pos, n.param2), tmp)
local level = redstone.level_at(get_wallmounted_node(pos, n.param2), {get_wallmounted_dir(pos, n.param2)})
if level <= 0 then
n.name = "redstone:torch_on"
minetest.env:set_node(pos, n)