fix: fix lua files conversion to module

This commit is contained in:
Kazhnuz 2021-05-15 19:49:11 +02:00
parent a1a130ae32
commit 05169782a2

View file

@ -27,12 +27,12 @@ local DATADIR = "datas"
local GAMEDATADIR = "gamedata"
function DataUtils.isLuaFile(name)
local extension = name:sub(#name - 4, #name)
local extension = name:sub(#name - 3, #name)
return (extension == ".lua")
end
function DataUtils.luaFileToModule(luaFile)
if (not DataUtils.isLuaFile(luaFile)) then
if (DataUtils.isLuaFile(luaFile)) then
return luaFile:sub(1, #luaFile - 4)
else
return luaFile