From 63409be0ee86531e6c2f1da8cdc0cabc77adafdb Mon Sep 17 00:00:00 2001 From: sys4-fr Date: Mon, 26 Mar 2018 19:43:58 +0200 Subject: [PATCH] Fix crash --- api.lua | 3 ++- modules/power/network.lua | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/api.lua b/api.lua index 61a55e9..408f350 100644 --- a/api.lua +++ b/api.lua @@ -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 = "" diff --git a/modules/power/network.lua b/modules/power/network.lua index 6d70146..e094f98 100644 --- a/modules/power/network.lua +++ b/modules/power/network.lua @@ -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