mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
factorio: award free samples to entire force
This commit is contained in:
23
data/factorio/mod/lib.lua
Normal file
23
data/factorio/mod/lib.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
function filter_ingredients(ingredients)
|
||||
local new_ingredient_list = {}
|
||||
for _, ingredient_table in pairs(ingredients) do
|
||||
if allowed_ingredients[ingredient_table[1]] then -- name of ingredient_table
|
||||
table.insert(new_ingredient_list, ingredient_table)
|
||||
end
|
||||
end
|
||||
|
||||
return new_ingredient_list
|
||||
end
|
||||
|
||||
function get_any_stack_size(name)
|
||||
local item = game.item_prototypes[name]
|
||||
if item ~= nil then
|
||||
return item.stack_size
|
||||
end
|
||||
item = game.equipment_prototypes[name]
|
||||
if item ~= nil then
|
||||
return item.stack_size
|
||||
end
|
||||
-- failsafe
|
||||
return 1
|
||||
end
|
Reference in New Issue
Block a user