fix errors when executing Lua mods being weird (not completely tested)

This commit is contained in:
Evil Factory
2022-03-16 06:39:57 -03:00
parent cc2a4b1b7b
commit 53c7bcc6d5
+11 -6
View File
@@ -39,13 +39,18 @@ local function endsWith(str, suffix)
return str:sub(-string.len(suffix)) == suffix return str:sub(-string.len(suffix)) == suffix
end end
local function runFolder(folder) local function executeProtected(s)
for k, str in pairs(File.DirSearch(folder)) do print(s)
local s = str:gsub("\\", "/") dofile(s)
end
if endsWith(str, ".lua") then local function runFolder(folder)
print(s) local search = File.DirSearch(folder)
dofile(s) for i = 1, #search, 1 do
local s = search[i]:gsub("\\", "/")
if endsWith(s, ".lua") then
executeProtected(s)
end end
end end