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)
end
-- Update texture
if auto_complete ~= false then
--if auto_complete ~= false then
if true then
for _,i in ipairs(def.tiles) do
if #def.tiles[_]:split("^") <= 1 then
local prefix = ""

View File

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