[1.2.3]Bug in surface_override API
Hello! I'm trying to use this API in my mod:https://mods.factorio.com/mod/space-factorissimo-lizard
But seems there is a problem with this API:
local surface_name = 'factory-floor-' .. global.next_factory_surface
local surface = game.surfaces[layout.surface_override or surface_name]
if surface == nil then
surface = game.create_surface(surface_name, {width = 2, height = 2})
surface.daytime = 0.5
surface.freeze_daytime = true
end
the "layout.surface_override" will change the value "surface" rather than "surface_name",this will cause many issues.
For example,other two commands can't work properly in this function:
global.surface_factories[surface_name] = global.surface_factories[surface_name] or {}
global.surface_factories[surface_name][n+1] = factory
I'm tring to input "space-factory-1" but the function is still using "factory-floor-1" instead.