Fix crash

This commit is contained in:
sys4-fr 2018-03-26 19:43:58 +02:00
parent 5a5ca11ecd
commit 63409be0ee
2 changed files with 8 additions and 7 deletions

View File

@ -116,7 +116,8 @@ function microexpansion.register_node(itemstring, def)
def.description = def.description .. "\n"..minetest.colorize("grey", def.usedfor) def.description = def.description .. "\n"..minetest.colorize("grey", def.usedfor)
end end
-- Update texture -- Update texture
if auto_complete ~= false then --if auto_complete ~= false then
if true then
for _,i in ipairs(def.tiles) do for _,i in ipairs(def.tiles) do
if #def.tiles[_]:split("^") <= 1 then if #def.tiles[_]:split("^") <= 1 then
local prefix = "" local prefix = ""

View File

@ -38,7 +38,7 @@ function me.get_node(pos)
end end
-- [function] Generate new network ID -- [function] Generate new network ID
function power.new_id() function me.power.new_id()
local count = 1 local count = 1
for _, i in pairs(me.networks) do for _, i in pairs(me.networks) do
count = count + 1 count = count + 1
@ -48,7 +48,7 @@ function power.new_id()
end end
-- [function] Can connect -- [function] Can connect
function power.can_connect(pos) function me.power.can_connect(pos)
local node = me.get_node(pos) local node = me.get_node(pos)
local res = minetest.get_item_group(node.name, "me_connect") local res = minetest.get_item_group(node.name, "me_connect")
@ -60,7 +60,7 @@ function power.can_connect(pos)
end end
-- [function] Get connected nodes -- [function] Get connected nodes
function power.get_connected_nodes(pos, include_ctrl) function me.power.get_connected_nodes(pos, include_ctrl)
local nodes = { local nodes = {
{x=pos.x+1, y=pos.y, z=pos.z}, {x=pos.x+1, y=pos.y, z=pos.z},
{x=pos.x-1, y=pos.y, z=pos.z}, {x=pos.x-1, y=pos.y, z=pos.z},
@ -86,18 +86,18 @@ function power.get_connected_nodes(pos, include_ctrl)
end end
-- [function] Add machine to network -- [function] Add machine to network
function power.add_machine(pos, def) function me.power.add_machine(pos, def)
end end
-- [function] Remove machine from network -- [function] Remove machine from network
function power.remove_machine(pos) function me.power.remove_machine(pos)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
meta:set_string("network_ignore", "true") meta:set_string("network_ignore", "true")
end end
-- [function] Trace network -- [function] Trace network
function power.trace(pos) function me.power.trace(pos)
local netpos = me.networks[minetest.get_meta(pos):get_string("network_id")] local netpos = me.networks[minetest.get_meta(pos):get_string("network_id")]
-- if no network, return -- if no network, return