replace global_exists with get_modpath

related: #97
This commit is contained in:
OgelGames 2023-11-21 14:35:51 +11:00
parent dc77d1056c
commit 7c74d0bdf3
3 changed files with 3 additions and 3 deletions

View File

@ -204,7 +204,7 @@ minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
-- Unified Inventory categories integration -- Unified Inventory categories integration
if minetest.global_exists("unified_inventory") and unified_inventory.registered_categories then if minetest.get_modpath("unified_inventory") and unified_inventory.registered_categories then
if not unified_inventory.registered_categories["automation"] then if not unified_inventory.registered_categories["automation"] then
unified_inventory.register_category("automation", { unified_inventory.register_category("automation", {
symbol = "pipeworks:lua_tube000000", symbol = "pipeworks:lua_tube000000",

View File

@ -425,7 +425,7 @@ end
-- itbl: Flat table of functions to run after sandbox cleanup, used to prevent various security hazards -- itbl: Flat table of functions to run after sandbox cleanup, used to prevent various security hazards
local function get_digiline_send(pos, itbl, send_warning) local function get_digiline_send(pos, itbl, send_warning)
if not minetest.global_exists("digilines") then return end if not minetest.get_modpath("digilines") then return end
local chan_maxlen = mesecon.setting("luacontroller_digiline_channel_maxlen", 256) local chan_maxlen = mesecon.setting("luacontroller_digiline_channel_maxlen", 256)
local maxlen = mesecon.setting("luacontroller_digiline_maxlen", 50000) local maxlen = mesecon.setting("luacontroller_digiline_maxlen", 50000)
return function(channel, msg) return function(channel, msg)

View File

@ -353,7 +353,7 @@ end
flowlogic.run_transition_post = function(pos, node) flowlogic.run_transition_post = function(pos, node)
local mesecons_def = minetest.registered_nodes[node.name].mesecons local mesecons_def = minetest.registered_nodes[node.name].mesecons
local mesecons_rules = pipeworks.flowables.transitions.mesecons[node.name] local mesecons_rules = pipeworks.flowables.transitions.mesecons[node.name]
if minetest.global_exists("mesecon") and (mesecons_def ~= nil) and mesecons_rules then if minetest.get_modpath("mesecons") and (mesecons_def ~= nil) and mesecons_rules then
if type(mesecons_def) ~= "table" then if type(mesecons_def) ~= "table" then
pipeworks.logger("flowlogic.run_transition_post() BUG mesecons def for "..node.name.."not a table: got "..tostring(mesecons_def)) pipeworks.logger("flowlogic.run_transition_post() BUG mesecons def for "..node.name.."not a table: got "..tostring(mesecons_def))
else else