Hi! Linox 1.8.11 crashes during mod loading with Kux-CoreLib 4.17.12.
The error occurs in "data-updates-loader.lua" when calling "_nuke_destruction_prevention()":
"bad argument #1 to 'insert' (table expected, got nil)"
The problem is that the code tries to insert a value into "surface_conditions", but this table doesnt always exist.
Check whether "surface_conditions" exists before inserting anything. If it's nil, initialize it as an empty table {}. Also, avoid adding duplicate conditions.
File: linox_1.8.11/modules/data-updates-loader.lua
Lines: 44–78, function _nuke_destruction_prevention().
The entire function needs to be replaced with this:
local function _nuke_destruction_prevention()
local explosion_names = {
"nuke-effects-nauvis",
"nuke-effects-aquilo",
"nuke-effects-vulcanus",
"nuke-effects-space",
}
for _, name in ipairs(explosion_names) do
local explosion = data.raw["explosion"][name]
if explosion then
local conditions = explosion.surface_conditions
if not conditions then
conditions = {}
explosion.surface_conditions = conditions
end
local found = false
for _, condition in pairs(conditions) do
if condition.property == "linox-no-nuke" then
condition.min = 0
condition.max = 0
found = true
break
end
end
if not found then
table.insert(conditions, {
property = "linox-no-nuke",
min = 0,
max = 0,
})
end
end
end
end
Wont make any definitive claims, but for me, at least, everything got fixed.
Please fix this in the next update. Have a nice day.