tubelib.get_node_number() added
parent
2190dd9199
commit
3d94842f04
13
command.lua
13
command.lua
|
@ -108,6 +108,19 @@ function tubelib.get_node_info(dest_num)
|
|||
return nil
|
||||
end
|
||||
|
||||
-- Function returns the node number from the given position or
|
||||
-- nil, if no node number for this position is assigned.
|
||||
function tubelib.get_node_number(pos)
|
||||
local key = get_key_str(pos)
|
||||
local num = Key2Number[key]
|
||||
if num then
|
||||
num = string.format("%.04u", num)
|
||||
if Number2Pos[num] and Number2Pos[num].name then
|
||||
return num
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- Node construction/destruction functions
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue