Skip to content

Commit

Permalink
angels productivity fix should work without boblibray now
Browse files Browse the repository at this point in the history
  • Loading branch information
mexmer committed Dec 9, 2020
1 parent 2d23af3 commit b2423f3
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions tweaks/productivity-limitations.lua
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
if mods["boblibrary"] then
local science_packs_and_intermediates =
{
"automation-science-pack",
"logistic-science-pack",
"chemical-science-pack",
"military-science-pack",
"production-science-pack",
"utility-science-pack",
"advanced-logistic-science-pack",
"alien-science-pack",
"science-pack-gold",
"omni-pack",
}
local science_packs_and_intermediates =
{
"automation-science-pack",
"logistic-science-pack",
"chemical-science-pack",
"military-science-pack",
"production-science-pack",
"utility-science-pack",
"advanced-logistic-science-pack",
"alien-science-pack",
"science-pack-gold",
"omni-pack",
}

local finallist = {}
local finallist = {}

-- Go through all the recipes defined in the science pack and intermidate list.
-- For any of them that exist, add them to the final list of things to limit.
for j, recipeName in pairs(science_packs_and_intermediates) do
if data.raw.recipe[recipeName] then
table.insert(finallist, recipeName)
end
end
if mods["angelsrefining"] then
for _, recipe_name in pairs(finallist) do
angelsmods.functions.allow_productivity(recipe_name)
end
else
bobmods.lib.module.add_productivity_limitations(finallist)
-- Go through all the recipes defined in the science pack and intermidate list.
-- For any of them that exist, add them to the final list of things to limit.
for j, recipeName in pairs(science_packs_and_intermediates) do
if data.raw.recipe[recipeName] then
table.insert(finallist, recipeName)
end
end

-- if angelsmod with productivity limit function exists, add it to list
if mods["angelsrefining"] and angelsmods and angelsmods.functions and angelsmods.functions.allow_productivity then
-- sctm.log("angelprodlimit")
angelsmods.functions.allow_productivity(finallist)
-- if bobsmod with productivity limit function exists, add it to list
elseif mods["boblibrary"] and bobmods and bobmods.lib and bobmods.lib.module and bobmods.lib.module.add_productivity_limitations then
-- sctm.log("bobprodlimit")
bobmods.lib.module.add_productivity_limitations(finallist)
end

0 comments on commit b2423f3

Please sign in to comment.