mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-11-09 17:03:58 +01:00
cache teleport tube logging setting
this gets checked every time an item is teleported
This commit is contained in:
parent
56bcc7dbb7
commit
2c880a3843
@ -3,6 +3,8 @@ local S = minetest.get_translator("pipeworks")
|
|||||||
local filename = minetest.get_worldpath().."/teleport_tubes" -- Only used for backward-compat
|
local filename = minetest.get_worldpath().."/teleport_tubes" -- Only used for backward-compat
|
||||||
local storage = minetest.get_mod_storage()
|
local storage = minetest.get_mod_storage()
|
||||||
|
|
||||||
|
local enable_logging = minetest.settings:get_bool("pipeworks_log_teleport_tubes", false)
|
||||||
|
|
||||||
local has_digilines = minetest.get_modpath("digilines")
|
local has_digilines = minetest.get_modpath("digilines")
|
||||||
|
|
||||||
-- V1: Serialized text file indexed by vector position.
|
-- V1: Serialized text file indexed by vector position.
|
||||||
@ -243,7 +245,7 @@ local function can_go(pos, node, velocity, stack)
|
|||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
local target = receivers[math.random(1, #receivers)]
|
local target = receivers[math.random(1, #receivers)]
|
||||||
if minetest.settings:get_bool("pipeworks_log_teleport_tubes", false) then
|
if enable_logging then
|
||||||
local src_owner = src_meta:get_string("owner")
|
local src_owner = src_meta:get_string("owner")
|
||||||
local dst_meta = minetest.get_meta(pos)
|
local dst_meta = minetest.get_meta(pos)
|
||||||
local dst_owner = dst_meta:get_string("owner")
|
local dst_owner = dst_meta:get_string("owner")
|
||||||
|
Loading…
Reference in New Issue
Block a user