BerbCorp Filter Assistant


Adds quick setting filters on inserters, splitters, filtered containers, requester/buffer chests and pumps.

Utilities
3 months ago
2.0 - 2.1
195

g fuel category error

a month ago
(updated a month ago)

7395.891 Error MainLoop.cpp:1488: Exception at tick 15213875: The mod BerbCorp Filter Assistant (2.1.3) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event berbcorp-filter-assistant::on_gui_opened (ID 104)
LuaItemPrototype doesn't contain key fuel_category.
stack traceback:
[C]: in function 'index'
__berbcorp-filter-assistant
/control.lua:184: in function 'fuel_items_for_category'
berbcorp-filter-assistant/control.lua:799: in function 'add_fuel_inputs'
berbcorp-filter-assistant/control.lua:846: in function 'add_drop_target_context'
berbcorp-filter-assistant/control.lua:894: in function 'add_inserter_context'
berbcorp-filter-assistant/control.lua:948: in function 'add_container_context'
berbcorp-filter-assistant/control.lua:1049: in function 'gather_context'
berbcorp-filter-assistant/control.lua:1299: in function 'refresh_player'
berbcorp-filter-assistant/control.lua:1403: in function <berbcorp-filter-assistant/control.lua:1385>
7415.989 Info AppManager.cpp:364: Deleting active scenario.

Here is a patched control.lua:

From line 176:

local fuel_category_cache
local function fuel_items_for_category(category)
if not setting_value("bcfa-include-fuel-items", true) then
return {}
end
if not fuel_category_cache then
fuel_category_cache = {}
for _, prototype in pairs(prototypes.item) do
local fuel_cats = prototype.fuel_categories
if fuel_cats then
for cat in pairs(fuel_cats) do
fuel_category_cache[cat] = fuel_category_cache[cat] or {}
table.insert(fuel_category_cache[cat], prototype)
end
end
end
end
return fuel_category_cache[category] or {}
end

New response