Advanced Furnaces 2 Extended


Adds more mod settings to the Load-Furn-2 mod and adds an integration with Bob's Logistics. Adds optional logic to drive smelts speeds for each furnace. Adds a new speedy Steel recipe from Coal and Iron. Loaders (if enabled in the base mod) now run at Belt Speeds set by Bob's Logistic mod settings and their recipes are found in the same group as Belts.

Tweaks
10 months ago
1.1
3.08K
Manufacturing

g K2SE incompatible?

11 months ago

k2Se cant start the mod

https://ibb.co/BgZTQH6

error.

11 months ago

Based on the provided code, it seems that the issue may be related to how the function get_total_energy_required_per_result is handling the data.raw.recipe[ingredient[1]] lookup. Specifically, if data.raw.recipe[ingredient[1]] is nil, it can lead to unexpected behavior.

Here's the relevant part of your code:

lua
Copy code
for i, ingredient in ipairs(ingredients) do
ingredient_energy_required = ingredient_energy_required + (get_total_energy_required_per_result(data.raw.recipe[ingredient[1]], expensive) * ingredient[2]);
end
If data.raw.recipe[ingredient[1]] is nil, then calling get_total_energy_required_per_result with a nil argument can lead to unexpected behavior or errors.

11 months ago

if ingredients then
for i, ingredient in ipairs(ingredients) do
local subRecipe = data.raw.recipe[ingredient[1]];
if subRecipe then
ingredient_energy_required = ingredient_energy_required + (get_total_energy_required_per_result(subRecipe, expensive) * ingredient[2]);
end

This made the game lauch not sure if it works as intended tho lmao

10 months ago

Apologies, I must have notifications blocked. Would be nice if other mods wouldn't create empty lists of ingredients so I wouldn't have to code so defensively... A correction has been made in the newest version and you've been credited.

10 months ago

I dont really need credit for adding 1 null check. On top considered its mostly work of ChatGPI.

Ive been dealing with coding in C# in unity and lets just say null checks must be EVERYWHERE. Omg so much crashing if scene loades differently.

New response