hopefully the last fix. added more checks

This commit is contained in:
Peter 2019-01-14 12:19:12 +08:00
parent 0e51848fcd
commit e64db2dfed
2 changed files with 26 additions and 18 deletions

View File

@ -143,6 +143,8 @@ if settings.startup["017-techtree"].value then
elseif valid == false then elseif valid == false then
break break
end end
elseif valid == false then
break
end end
end end
end end
@ -157,25 +159,31 @@ if settings.startup["017-techtree"].value then
end end
for _, tech in pairs(data.raw["technology"]) do for _, tech in pairs(data.raw["technology"]) do
if tech.effects then if tech.name ~= ("logistics-science-pack" or "chemical-science-pack" or "production-science-pack" or "utility-science-pack") then
for i=1, #tech.effects do if tech.effects then
if tech.effects[i].type then if #tech.effects ~= 0 then
if tech.effects[i].type == "unlock-recipe" then for i=1, #tech.effects do
whitelisted = true if tech.effects[i] then
break if tech.effects[i].type then
else if tech.effects[i].type == "unlock-recipe" then
whitelisted = false whitelisted = true
break
else
whitelisted = false
end
end
end
end end
end end
end if whitelisted == true then
if whitelisted == true then local valid = compare(tech, "logistics-science-pack", "science-pack-2")
local valid = compare(tech, "logistics-science-pack", "science-pack-2") if valid == false then
if valid == false then local valid = compare(tech, "chemical-science-pack", "science-pack-3") end
local valid = compare(tech, "chemical-science-pack", "science-pack-3") end if valid == false then
if valid == false then local valid = compare(tech, "production-science-pack", "production-science-pack") end
local valid = compare(tech, "production-science-pack", "production-science-pack") end if valid == false then
if valid == false then local valid = compare(tech, "utility-science-pack", "high-tech-science-pack") end
local valid = compare(tech, "utility-science-pack", "high-tech-science-pack") end end
end end
end end
end end

View File

@ -1,6 +1,6 @@
{ {
"name": "017_science", "name": "017_science",
"version": "0.0.14", "version": "0.0.15",
"factorio_version": "0.16", "factorio_version": "0.16",
"title": "0.17 science conversion", "title": "0.17 science conversion",
"author": "npc_strider(morley376)", "author": "npc_strider(morley376)",