--- SeaBlock_0.4.4/control.lua.orig 2020-04-13 15:31:33.075321135 +0200 +++ SeaBlock_0.4.4/control.lua 2020-04-13 15:31:12.159116043 +0200 @@ -89,21 +89,36 @@ local function init() setpvp() global.unlocks = { - ['angels-ore3-crushed'] = 'sb-startup1', - ['basic-circuit-board'] = 'sb-startup2', - ['algae-green'] = 'bio-wood-processing', + ['angels-ore3-crushed'] = {'sb-startup1'}, + ['basic-circuit-board'] = {'sb-startup2'}, + ['algae-green'] = {'bio-wood-processing'}, + ['lab'] = {}, } if game.technology_prototypes['sct-automation-science-pack'] then - global.unlocks['lab'] = 'sct-automation-science-pack' + table.insert(global.unlocks['lab'], 'sct-automation-science-pack') else - global.unlocks['lab'] = 'sb-startup4' + table.insert(global.unlocks['lab'], 'sb-startup4') + end + if game.technology_prototypes['deadlock-stacking--sb-algae-green-tool'] then + table.insert(global.unlocks['algae-green'], 'deadlock-stacking--sb-algae-green-tool') end + if game.technology_prototypes['deadlock-stacking--sb-angelsore3-tool'] then + table.insert(global.unlocks['angels-ore3-crushed'], 'deadlock-stacking--sb-angelsore3-tool') + end + if game.technology_prototypes['deadlock-stacking--sb-basic-circuit-board-tool'] then + table.insert(global.unlocks['basic-circuit-board'], 'deadlock-stacking--sb-basic-circuit-board-tool') + end + if game.technology_prototypes['deadlock-stacking--sb-lab-tool'] then + table.insert(global.unlocks['lab'], 'deadlock-stacking--sb-lab-tool') + end end local function haveitem(player, itemname, crafted) local unlock = global.unlocks[itemname] -- Special case for basic-circuit because it is part of starting equipment if unlock and (itemname ~= 'basic-circuit-board' or crafted) then - player.force.technologies[unlock].researched = true + for _, name in ipairs(unlock) do + player.force.technologies[name].researched = true + end end end @@ -134,9 +149,11 @@ if not inv then -- Compatibility with BlueprintLab_Bud17 return end - for k,v in pairs(global.unlocks) do - if not player.force.technologies[v].researched and inv.get_item_count(k) > 0 then - haveitem(player, k, false) + for k,vs in pairs(global.unlocks) do + for _,v in ipairs(vs) do + if not player.force.technologies[v].researched and inv.get_item_count(k) > 0 then + haveitem(player, k, false) + end end end end)