Check that mod is a folder and not empty
This commit is contained in:
parent
f8e19bfed2
commit
94beeb14c9
@ -85,14 +85,16 @@ LUI.MenuBuilder.m_types_build["mods_menu"] = function(a1)
|
|||||||
if (io.directoryexists("mods")) then
|
if (io.directoryexists("mods")) then
|
||||||
local mods = io.listfiles("mods/")
|
local mods = io.listfiles("mods/")
|
||||||
for i = 1, #mods do
|
for i = 1, #mods do
|
||||||
local name, desc = getmodname(mods[i])
|
if (io.directoryexists(mods[i]) and not io.directoryisempty(mods[i])) then
|
||||||
|
local name, desc = getmodname(mods[i])
|
||||||
|
|
||||||
if (mods[i] ~= modfolder) then
|
if (mods[i] ~= modfolder) then
|
||||||
menu:AddButton("$_" .. name, function()
|
menu:AddButton("$_" .. name, function()
|
||||||
game:executecommand("loadmod " .. mods[i])
|
game:executecommand("loadmod " .. mods[i])
|
||||||
end, nil, true, nil, {
|
end, nil, true, nil, {
|
||||||
desc_text = desc
|
desc_text = desc
|
||||||
})
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user