generator-equipment uses wood as fuel

This commit is contained in:
Simon Brodtmann 2025-01-24 10:47:03 +01:00
parent 2de7af444b
commit 0c064f7a00

View file

@ -16,13 +16,15 @@ local blacklist = {}
function update_fuel_categories(t) function update_fuel_categories(t)
for _, entity in pairs(t) do for _, entity in pairs(t) do
if entity.energy_source for _, energy_source in pairs({ "energy_source", "burner" }) do
and entity.energy_source.type == "burner" if entity[energy_source]
and entity[energy_source].type == "burner"
and not table.contains(blacklist, entity.name) and not table.contains(blacklist, entity.name)
and entity.energy_source.fuel_categories and entity[energy_source].fuel_categories
and table.contains(entity.energy_source.fuel_categories, "chemical") and table.contains(entity[energy_source].fuel_categories, "chemical")
then then
table.insert(entity.energy_source.fuel_categories, "wood") table.insert(entity[energy_source].fuel_categories, "wood")
end
end end
end end
end end
@ -31,3 +33,4 @@ end
update_fuel_categories(data.raw["boiler"]) update_fuel_categories(data.raw["boiler"])
update_fuel_categories(data.raw["reactor"]) update_fuel_categories(data.raw["reactor"])
update_fuel_categories(data.raw["car"]) update_fuel_categories(data.raw["car"])
update_fuel_categories(data.raw["generator-equipment"])