Steel compactor/Recycler issues

In my version (0.4), the steel compactor can make a steel chunk from a single steel item, I tried checking the source code but I’m not sure If it checks for weight or what it really does…
Edit : after more searching/testing, I can now say that the steel compactor will only count how many items made of steel are on his tile, and then make a steel lump for every 10 items, and a steel chunk for every 3 items.
Moreover, any steel item will do, so you can actually turn a BB pellet (and probably other stuff) into a steel chunk with the compactor, just as if it was a steel pipe.

Therefore, if I make 4 chunks from 4 BBs, I can then make a lump through crafting, and 3 lumps make a frame so that’s 12BBs to make a steel frame (240 weight) for a vehicle.
Sounds legit.

I’m not sure what the fix could be but there’s probably a way to correct that.

The issue is that in iexamine.cpp, the function “recycler” uses a “do while” loop for chunk creation, meaning that a chunk will always be generated if there’s at least one steel item to start the loop, and even if there was just enough items for a single lump. The fix would be using a while loop.

A better fix would be a rehaul of the compactor code to account for weight, and also a normalization of the steel items weight values and recipes.

(Edited)

Yeah, there probably was some logic behind how the compactor was initially coded, but for the life of me I can’t figure out what.

In any case, I’ll push out some new recycler code that does what you described soon.

Aw! Damnit! I enjoyed that particular exploit.

(But ok, fair enough. It would be nice if the code could be tweaked to include some more specific recipes. Even accounting for weights, it seems odd that scrap metal should be compactable with the same efficiency as, say, pipes or frames, which are solid and consistent chunks of metal.)