Factorio: sync already cleared locations to local world

This commit is contained in:
Fabian Dill
2021-08-07 01:01:56 +02:00
parent 4b38cb4c2e
commit cd8452d839
2 changed files with 15 additions and 1 deletions

View File

@@ -373,7 +373,15 @@ commands.add_command("ap-get-technology", "Grant a technology, used by the Archi
local item_name = chunks[1]
local index = chunks[2]
local source = chunks[3] or "Archipelago"
if progressive_technologies[item_name] ~= nil then
if index == -1 then -- for coop sync and restoring from an older savegame
tech = force.technologies[item_name]
if tech.researched ~= true then
game.print({"", "Received [technology=" .. tech.name .. "] as it is already checked.")
game.play_sound({path="utility/research_completed"})
tech.researched = true
return
end
elif progressive_technologies[item_name] ~= nil then
if global.index_sync[index] == nil then -- not yet received prog item
global.index_sync[index] = item_name
local tech_stack = progressive_technologies[item_name]