Sometimes server crashes.
I have a mod with following code:
mods = {}
local function SearchForModsByName()
if mods.active_mods_by_name then
return --Already initialized.
end
mods.active_mods_by_name = {}
if not (_G.KnownModIndex and _G.KnownModIndex.savedata and _G.KnownModIndex.savedata.known_mods) then
print("ERROR COMMON LIB: Can't find KnownModIndex!")
return
end
for name,mod in pairs(_G.KnownModIndex.savedata.known_mods) do
if (mod.enabled or mod.temp_enabled or _G.KnownModIndex:IsModForceEnabled(name)) --Mod is active.
and not mod.temp_disabled --And not disabled.
then
local real_name = mod.modinfo.name
mods.active_mods_by_name[real_name] = true
end
end
end
Server crashes on line:
mods.active_mods_by_name[real_name] = true
with message:
[00:15:25]: [string "../mods/workshop-666155465/modmain.lua"]:280: table index is nil
Does it mean that mod.modinfo is real table but mod.modinfo.name is nil? Is it bug of the game or I missed something?
print(mod.modinfo) -- a table
print(mod.modinfo.name) -- nil
I'm just trying to detect some other mods to improve compatibility with my mod.
Steps to Reproduce
I can't tell you the steps because it's random rare issue. I think it depends on how correct mods are downloaded. But it's only my opinion. I have only log.txt http://pastebin.com/XfNwqiBw
I can't tell you the steps because it's random rare issue. I think it depends on how correct mods are downloaded. But it's only my opinion. I have only log.txt http://pastebin.com/XfNwqiBw
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now