Merge pull request #11 from gl00my/jumpdrive_pipeworks

jumpdrive: pipeworks friendly
This commit is contained in:
Sergei Mozhaisky 2019-11-21 13:29:18 +02:00 committed by GitHub
commit 2f46cb88d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,19 @@ local function read_tube_db()
return tp_tube_db
end
-- expose for external batch use (jumpdrive)
pipeworks.tptube = {
hash = hash,
save_tube_db = function(...)
if not tp_tube_db then -- db not loaded
return
end
return save_tube_db(...)
end,
get_db = function() return tp_tube_db or read_tube_db() end,
tp_tube_db_version = tp_tube_db_version
}
-- debug formatter for coordinates used below
local fmt = function(pos)
return pos.x..", "..pos.y..", "..pos.z