tubelib.get_node_number() added

master
Joachim Stolberg 2017-10-08 17:41:44 +02:00
parent 2190dd9199
commit 3d94842f04
2 changed files with 13 additions and 0 deletions

View File

@ -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