Hello,
A bug occurred when I wanted to update a mod on a server. The server crashed during startup.
Here is the error recovered in the logs:
Error while running event Rocket-Silo-Construction::on_init()
__Rocket-Silo-Construction__/control.lua:23: attempt to index local 'force' (a nil value)
stack traceback:
__Rocket-Silo-Construction__/control.lua:23: in function 'ModSetup'
__Rocket-Silo-Construction__/control.lua:36: in function
<__Rocket-Silo-Construction__/control.lua:35>
I was able to correct the error to be able to restart my server without problem. I let you perhaps adapt the correction yourself but here is the correction code:
function ModSetup()
if global.rsc_silo_under_construction==nil then global.rsc_silo_under_construction={} end
global.st_insert_material_work = settings.startup["rsc-st-work-for-insert-material"].value
global.st_remove_stone_work = settings.startup["rsc-st-work-for-remove-stone"].value
global.st_not_removable_silo = settings.startup["rsc-st-not-removable-silo"].value
global.st_dont_place_tiles = settings.startup["rsc-st-dont-place-tiles"].value
for f=1, #game.forces do
local force = game.forces[f]
if force ~= nil then
if force.technologies then
if force.technologies['rocket-silo'] and force.technologies['rocket-silo'].researched then
force.recipes['rsc-excavation-site'].enabled = true
end
if force.technologies['se-rocket-launch-pad'] and force.technologies['se-rocket-launch-pad'].researched then
force.recipes['rsc-serlp-excavation-site'].enabled = true
end
end
end
end
end
Thank you.