Fixed Existing Lua Check Errors

This commit is contained in:
Cooldude2606
2020-05-26 18:21:10 +01:00
parent 2aaeb06be3
commit 32507492b8
76 changed files with 1622 additions and 1617 deletions

View File

@@ -22,23 +22,23 @@ log('[INFO] Getting file loader config')
local files = require 'config._file_loader' --- @dep config._file_loader
-- Loads all files from the config and logs that they are loaded
local total_file_count = string.format('%3d',#files)
local total_file_count = string.format('%3d', #files)
local errors = {}
for index,path in pairs(files) do
for index, path in pairs(files) do
-- Loads the next file in the list
log(string.format('[INFO] Loading file %3d/%s (%s)',index,total_file_count,path))
local success,file = pcall(require,path)
log(string.format('[INFO] Loading file %3d/%s (%s)', index, total_file_count, path))
local success, file = pcall(require, path)
-- Error Checking
if not success then
-- Failed to load a file
log('[ERROR] Failed to load file: '..path)
table.insert(errors,'[ERROR] '..path..' :: '..file)
table.insert(errors, '[ERROR] '..path..' :: '..file)
elseif type(file) == 'string' and file:find('not found') then
-- Returned a file not found message
log('[ERROR] File not found: '..path)
table.insert(errors,'[ERROR] '..path..' :: Not Found')
table.insert(errors, '[ERROR] '..path..' :: Not Found')
end
end
@@ -49,5 +49,5 @@ require 'overrides.require'
-- Logs all errors again to make it make it easy to find
log('[INFO] All files loaded with '..#errors..' errors:')
for _,error in pairs(errors) do log(error) end
for _, error in pairs(errors) do log(error) end
log('[END] -----| Explosive Gaming Scenario Loader |-----')