Make some xdoors2 functions global & add mesecons support

master
Ilya Zhuravlev 2012-09-05 21:48:20 +04:00
parent 61cac697b6
commit 8033915df1
4 changed files with 26 additions and 2 deletions

View File

@ -18,7 +18,7 @@ local is_top = function(name)
return name:sub(14, 14) == "t"
end
local xdoors2_transform = function(pos, node)
xdoors2_transform = function(pos, node)
if is_top(node.name) then
pos = {x = pos.x, y = pos.y - 1, z = pos.z}
end
@ -33,7 +33,7 @@ local xdoors2_transform = function(pos, node)
minetest.env:add_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "xdoors2:door_top_"..t, param2 = p2})
end
local xdoors2_destruct = function(pos, oldnode)
xdoors2_destruct = function(pos, oldnode)
if is_top(oldnode.name) then
pos = {x = pos.x, y = pos.y - 1, z = pos.z}
end

14
xdoors2_mesecons/COPYING Normal file
View File

@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

View File

@ -0,0 +1,2 @@
mesecons
xdoors2

View File

@ -0,0 +1,8 @@
mesecon:register_on_signal_change(function(pos, node)
if string.find(node.name, "xdoors2:door_bottom_") then
xdoors2_transform(pos, node)
end
end)
mesecon:register_effector("xdoors2:door_bottom_1")
mesecon:register_effector("xdoors2:door_bottom_2")