Trying to show this properly...
-- Check if automated construction is researched and change auto_cons_researched to true if so.
function auto_cons_check (force)
if force then
if force.technologies["logistic-robotics"].researched then
auto_cons_researched = true
end
elseif game.players[1] and game.players[1].force.technologies["logistic-robotics"].researched then
auto_cons_researched = true
end
end
-- *** Scripts ***
--Check if automated construction is researched when a research is finished
script.on_event(defines.events.on_research_finished, function(event)
auto_cons_check(event.research.force)
end)
It's probably not 100% accurate to what you'd like to happen all the time, but it A) avoids the bug and B) adds safety if there's not a player 1 but there is player 2 or something. It'll do the old stuff but prevent the new bug.
Edit: I had to check if calling that with no argument was an error, lol. Some base game functions cause errors if you miss an argument