Skip to content

Commit

Permalink
Applied a fix to incinerator-recipes.lua. It will no longer create an
Browse files Browse the repository at this point in the history
incinerator recipe for items that are raw materials and have a fuel
value.

These items should be used as fuel in the incinerator and not as
ingredients.

This prevents the incinerator from parasitising its own fuel supply.
  • Loading branch information
malexgit authored and judos committed Apr 2, 2017
1 parent 222c127 commit 7f46cd3
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions source/prototypes/incinerator-recipes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,33 @@ for _,typ in pairs(types) do
local time = 4
if burnTime[name] then time = burnTime[name] end

data:extend({
{
type = "recipe",
name = "incinerate_"..name,
category = "incinerator",
icon = "__hardCrafting__/graphics/icons/fire.png",
hidden = true,
ingredients = {{name, 1}},
energy_required = time,
results =
--Get the fuel value of the item.
local fuelValue
if itemTable.fuel_value then
fuelValue = tonumber(itemTable.fuel_value:sub(1,itemTable.fuel_value:len()-2))
else
fuelValue = 0
end

--If the item is a raw material and has a fuel value, dont create an incinerator recipe for it.
if itemTable.subgroup == "raw-material" and fuelValue > 0 then
else
data:extend({
{
{type="item", name="coal-dust", probability=0.1, amount_min=1, amount_max=1},
type = "recipe",
name = "incinerate_"..name,
category = "incinerator",
icon = "__hardCrafting__/graphics/icons/fire.png",
hidden = true,
ingredients = {{name, 1}},
energy_required = time,
results =
{
{type="item", name="coal-dust", probability=0.1, amount_min=1, amount_max=1},
}
}
}
})
})
end

end
end

0 comments on commit 7f46cd3

Please sign in to comment.