Xman1109 / Atomic_Overhaul

https://mods.factorio.com/mod/Atomic_Overhaul/downloads
Other
7 stars 5 forks source link

Heat recipes improvements #43

Closed leanora-polera closed 11 months ago

leanora-polera commented 11 months ago

Hi there,

I like your mod ... however the heat furnace did not work at all with brevven's mods (bztitanium, bzcarbon, ...). It was missing all recipes (aluminum plate, tin plate, to name a few).

I looked at the source and tried to understand your recipe deriving algorithm. While doing that I refactored it, so I could understand it. The result is in this PR in the hope that you find it useful. Your source had a lot of code duplication I managed to reduce it by three quarters! Don't be afraid by the number of commits, most commits are very small and usually do only one thing. I don't recount what they do, please see the individual commit messages for that.

While doing the refactor I also fixed some bugs lurking in the code, e.g. handle all cases of normal, expensive ingredients, results, check both abc.name and abc[1] for the name of the item/recipe/ingredient, etc.

Beyond that I altered the algorithm in the following way (which might or might not count as bugs):

Have fun!