-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
14 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +0,0 @@ | ||
if not bobmods.lib.module then | ||
bobmods.lib.module = {} | ||
bobmods.lib.module.excluded_prod_modules = {} | ||
end | ||
|
||
function bobmods.lib.module.exclude_productivity_module(module_name) | ||
if type(module_name) == "string" then | ||
if data.raw.module[module_name] then | ||
bobmods.lib.module.excluded_prod_modules[module_name] = true | ||
end | ||
else | ||
log(debug.traceback()) | ||
end | ||
end | ||
|
||
function bobmods.lib.module.add_productivity_limitation(recipe) | ||
if type(recipe) == "string" and data.raw.recipe[recipe] then | ||
for i, module in pairs(data.raw.module) do | ||
if | ||
not bobmods.lib.module.excluded_prod_modules[module.name] | ||
and module.limitation | ||
and module.effect.productivity | ||
then | ||
table.insert(module.limitation, recipe) | ||
end | ||
end | ||
else | ||
log(debug.traceback()) | ||
bobmods.lib.error.recipe(recipe) | ||
end | ||
end | ||
|
||
function bobmods.lib.module.add_productivity_limitations(recipes) | ||
if type(recipes) == "table" then | ||
for j, recipe in pairs(recipes) do | ||
bobmods.lib.module.add_productivity_limitation(recipe) | ||
end | ||
else | ||
log(debug.traceback()) | ||
log("Expected table.") | ||
end | ||
end | ||
|
||
function bobmods.lib.module.remove_productivity_limitation(recipe) | ||
if type(recipe) == "string" and data.raw.recipe[recipe] then | ||
for i, module in pairs(data.raw.module) do | ||
if module.limitation and module.effect.productivity then | ||
for limitationIndex, limitationRecipeName in pairs(module.limitation) do | ||
if recipe == limitationRecipeName then | ||
table.remove(module.limitation, limitationIndex) | ||
end | ||
end | ||
end | ||
end | ||
else | ||
log(debug.traceback()) | ||
bobmods.lib.error.recipe(recipe) | ||
end | ||
end | ||
|
||
function bobmods.lib.module.remove_productivity_limitations(recipes) | ||
if type(recipes) == "table" then | ||
for j, recipe in pairs(recipes) do | ||
bobmods.lib.module.remove_productivity_limitation(recipe) | ||
end | ||
else | ||
log(debug.traceback()) | ||
log("Expected table.") | ||
end | ||
end | ||