mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2024-12-29 17:07:35 +01:00
slight change in the teleporters file and add luacontroller detection
This commit is contained in:
parent
a2f59a0b6d
commit
d095fecefa
@ -57,11 +57,7 @@ local function get_selection_formspec(pname, selected_template)
|
||||
end
|
||||
|
||||
local function is_luacontroller(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name ~= ":luacontroller" then
|
||||
return false
|
||||
end
|
||||
|
||||
return string.match(minetest.get_node(pos).name, "mesecons_luacontroller:luacontroller%d%d%d%d")
|
||||
end
|
||||
|
||||
minetest.register_tool("moremesecons_luacontroller_tool:luacontroller_template_tool", {
|
||||
|
@ -3,8 +3,7 @@ local teleporters_rids = {}
|
||||
|
||||
|
||||
local register = function(pos)
|
||||
local RID = vector.get_data_from_pos(teleporters_rids, pos.z,pos.y,pos.x)
|
||||
if not RID then
|
||||
if not vector.get_data_from_pos(teleporters_rids, pos.z,pos.y,pos.x) then
|
||||
table.insert(teleporters, pos)
|
||||
vector.set_data_to_pos(teleporters_rids, pos.z,pos.y,pos.x, #teleporters)
|
||||
end
|
||||
@ -89,8 +88,9 @@ minetest.register_node("moremesecons_teleporter:teleporter", {
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"moremesecons_teleporter:teleporter"},
|
||||
interval=1,
|
||||
interval=5,
|
||||
chance=1,
|
||||
catch_up = false,
|
||||
action = function(pos)
|
||||
register(pos)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user