1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-02-05 13:15:03 +02:00
This commit is contained in:
Gerkiz 2024-10-22 22:29:03 +02:00
parent 3150ab9b0a
commit 4a0c0dffa7

View File

@ -40,6 +40,18 @@ local bps_blacklist = {
['blueprint'] = true
}
local get_filters = function (points)
local filters = {}
for _, section in pairs(points.sections) do
for _, filter in pairs(section.filters) do
if filter and filter.value and filter.value.name then
filters[#filters + 1] = filter
end
end
end
return filters
end
local on_init_token =
Task.register(
function ()
@ -261,22 +273,11 @@ local function check_if_valid_requests(chest)
end
if chest.type == 'logistic-container' then
local filters = {}
local get_filters = function (points)
for _, section in pairs(points.sections) do
for _, filter in pairs(section.filters) do
if filter and filter.value and filter.value.name then
filters[#filters + 1] = filter
end
end
end
end
local logistics = chest.get_logistic_point(defines.logistic_member_index.logistic_container)
local count = get_filters(logistics)
return #count > 0
local filters = get_filters(logistics)
return #filters > 0
end
return false
end