Fix crash
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user