Working on Init Bugs

This commit is contained in:
Cooldude2606
2018-10-12 19:23:02 +01:00
parent 0b6009e92e
commit ba3a01f9d6
7 changed files with 12 additions and 8 deletions

View File

@@ -466,7 +466,9 @@ Manager.error = setmetatable({
rawset(tbl,'__crash',true) rawset(tbl,'__crash',true)
rawget(tbl,'__error_call')(err,2) rawget(tbl,'__error_call')(err,2)
end end
rawget(tbl,'__error_call')(err,2) local args = {...}
local trace = args[1] and type(args[1]) == 'number' and args[1] or 2
rawget(tbl,'__error_call')(err,trace)
end, end,
__index=function(tbl,key) __index=function(tbl,key)
-- this allows the __error_handler to be called from many different names -- this allows the __error_handler to be called from many different names

View File

@@ -14,6 +14,7 @@
], ],
"dependencies": { "dependencies": {
"FactorioStdLib": "^0.8.0", "FactorioStdLib": "^0.8.0",
"ExpGamingCore.Server": "?^4.0.0",
"ExpGamingLib": "^4.0.0" "ExpGamingLib": "^4.0.0"
}, },
"collection": "ExpGamingCore_4.0.0" "collection": "ExpGamingCore_4.0.0"

View File

@@ -167,7 +167,7 @@ end
function Role.get_highest(options) function Role.get_highest(options)
local player = Game.get_player(options) local player = Game.get_player(options)
if player then options = Role.get(player) end if player then options = Role.get(player) end
if not type_error(options,'table','Invalid argument #1 to Role.highest, options is not a table of roles.') then return end if not type_error(options,'table','Invalid argument #1 to Role.get_highest, options is not a table of roles.') then return end
local highest_index = -1 local highest_index = -1
local highest local highest
for _,role_name in pairs(options) do for _,role_name in pairs(options) do

View File

@@ -21,6 +21,7 @@ local warp_item = 'discharge-defense-equipment'
local global_offset = {x=0,y=0} local global_offset = {x=0,y=0}
-- Module Define -- Module Define
local _global = global
local global local global
local module_verbose = false local module_verbose = false
local ThisModule = { local ThisModule = {
@@ -31,7 +32,7 @@ local ThisModule = {
} }
-- Global Define -- Global Define
global = global{ global = _global{
warps={}, -- 0,0 is always a warp warps={}, -- 0,0 is always a warp
cooldowns={} cooldowns={}
} }
@@ -209,7 +210,7 @@ ThisModule.Gui = Gui.left{
-- Event Handlers Define -- Event Handlers Define
script.on_event(defines.events.on_tick,function(event) script.on_event(defines.events.on_tick,function(event)
if not (event.tick % 60 == 0) then return end if not (event.tick % 60 == 0) then return end
for index,time in pairs(_warps().cooldowns) do for index,time in pairs(global.cooldowns) do
if time > 0 then if time > 0 then
global.cooldowns[index] = time-1 global.cooldowns[index] = time-1
if global.cooldowns[index] == 0 then player_return({'warp-system.cooldown-zero'},defines.textcolor.low,index) end if global.cooldowns[index] == 0 then player_return({'warp-system.cooldown-zero'},defines.textcolor.low,index) end

View File

@@ -5,7 +5,7 @@
-- @alais ThisModule -- @alais ThisModule
-- Module Require -- Module Require
local Game = require('FactorioStdLib@^0.8.0') local Game = require('FactorioStdLib.Game@^0.8.0')
-- Local Varibles -- Local Varibles
local entites = require(module_path..'/src/entites') local entites = require(module_path..'/src/entites')

View File

@@ -1,4 +1,4 @@
local paths = { return {
-- ['tile name'] = {health,convert to} -- ['tile name'] = {health,convert to}
-- the greater health is the lower the chance it will be down graded, must be grater than 0 -- the greater health is the lower the chance it will be down graded, must be grater than 0
['refined-concrete']={70,'concrete'}, ['refined-concrete']={70,'concrete'},

View File

@@ -22,13 +22,13 @@ return {
['ExpGamingLib@^4.0.0']='./modules/ExpGamingLib', ['ExpGamingLib@^4.0.0']='./modules/ExpGamingLib',
['ExpGamingLib@4.0.0']='./modules/ExpGamingLib', ['ExpGamingLib@4.0.0']='./modules/ExpGamingLib',
['ExpGamingCore.Command@^4.0.0']='./modules/ExpGamingCore/Command', ['ExpGamingCore.Command@^4.0.0']='./modules/ExpGamingCore/Command',
['ExpGamingCore.Group@^4.0.0']='./modules/ExpGamingCore/Group',
['ExpGamingCore.Group@4.0.0']='./modules/ExpGamingCore/Group',
['ExpGamingCore.Server@^4.0.0']='./modules/ExpGamingCore/Server', ['ExpGamingCore.Server@^4.0.0']='./modules/ExpGamingCore/Server',
['ExpGamingCore.Command@4.0.0']='./modules/ExpGamingCore/Command', ['ExpGamingCore.Command@4.0.0']='./modules/ExpGamingCore/Command',
['ExpGamingCommands.home@4.0.0']='./modules/ExpGamingCommands/home', ['ExpGamingCommands.home@4.0.0']='./modules/ExpGamingCommands/home',
['ExpGamingCommands.cheatMode@4.0.0']='./modules/ExpGamingCommands/cheatMode', ['ExpGamingCommands.cheatMode@4.0.0']='./modules/ExpGamingCommands/cheatMode',
['ExpGamingCore.Server@4.0.0']='./modules/ExpGamingCore/Server', ['ExpGamingCore.Server@4.0.0']='./modules/ExpGamingCore/Server',
['ExpGamingCore.Group@^4.0.0']='./modules/ExpGamingCore/Group',
['ExpGamingCore.Group@4.0.0']='./modules/ExpGamingCore/Group',
['ExpGamingCore.Role@^4.0.0']='./modules/ExpGamingCore/Role', ['ExpGamingCore.Role@^4.0.0']='./modules/ExpGamingCore/Role',
['ExpGamingCore.Role@4.0.0']='./modules/ExpGamingCore/Role', ['ExpGamingCore.Role@4.0.0']='./modules/ExpGamingCore/Role',
['ExpGamingCommands.tags@4.0.0']='./modules/ExpGamingCommands/tags', ['ExpGamingCommands.tags@4.0.0']='./modules/ExpGamingCommands/tags',