Pathfinding: Fix for mod security - joining up Jumper library code (WIP)
This commit is contained in:
26
init.lua
26
init.lua
@ -1,6 +1,30 @@
|
||||
-- Advanced NPC mod by Zorman2000
|
||||
local path = minetest.get_modpath("advanced_npc")
|
||||
|
||||
-- Below code for require is taken and slightly modified
|
||||
-- from irc mod by Diego Martinez (kaeza)
|
||||
-- https://github.com/minetest-mods/irc
|
||||
-- Handle mod security if needed
|
||||
-- local ie = minetest.request_insecure_environment()
|
||||
-- -- local req_ie = minetest.request_insecure_environment()
|
||||
-- -- if req_ie then
|
||||
-- -- ie = req_ie
|
||||
-- -- end
|
||||
-- if not ie then
|
||||
-- error("The Advanced NPC mod requires access to insecure functions in "..
|
||||
-- "order to work. Please add the Advanced NPC mod to the "..
|
||||
-- "secure.trusted_mods setting or disable the mod.")
|
||||
-- end
|
||||
|
||||
-- -- Modify package path so that it can find the Jumper library files
|
||||
-- ie.package.path =
|
||||
-- path .. "/Jumper/?.lua;"..
|
||||
-- ie.package.path
|
||||
|
||||
-- -- Require the main files from Jumper
|
||||
-- Grid = ie.require("jumper.grid")
|
||||
-- Pathfinder = ie.require("jumper.pathfinder")
|
||||
|
||||
-- Intllib
|
||||
local S
|
||||
if minetest.get_modpath("intllib") then
|
||||
@ -33,6 +57,8 @@ dofile(path .. "/trade/prices.lua")
|
||||
dofile(path .. "/actions/actions.lua")
|
||||
dofile(path .. "/actions/places.lua")
|
||||
dofile(path .. "/actions/pathfinder.lua")
|
||||
dofile(path .. "/actions/pathfinding.lua")
|
||||
--dofile(path .. "/actions/pathfinder2.lua")
|
||||
dofile(path .. "/actions/node_registry.lua")
|
||||
dofile(path .. "/random_data.lua")
|
||||
|
||||
|
Reference in New Issue
Block a user