Updated Module to use require

This commit is contained in:
Cooldude2606
2018-06-22 19:17:36 +01:00
parent 5602a2aece
commit 90450056bf
47 changed files with 1042 additions and 504 deletions

View File

@@ -4,6 +4,9 @@
-- @author Cooldude2606
-- @license https://github.com/explosivegaming/scenario/blob/master/LICENSE
local Game = require('FactorioStdLib.Game')
local Color = require('FactorioStdLib.Color')
local Server = {}
local module_verbose = false --true|false
@@ -464,7 +467,7 @@ end)
function Server:on_init()
for name,id in pairs(defines.events) do if not script.get_event_handler(id) then script.on_event(id,Server._thread_handler) end end
if loaded_modules.commands then verbose('ExpGamingCore.Commands is installed; Loading commands src') require(module_path..'/src/commands') end
if loaded_modules['ExpGamingCore.Commands'] then verbose('ExpGamingCore.Commands is installed; Loading commands src') require(module_path..'/src/commands',{Server=Server}) end
end
return Server