[kovarex] [0.17.23] Handcraft infinite free items
Posted: Sun Mar 31, 2019 9:25 pm
This bug is largely related to the Production Scrap mod, but the root cause might impact other things.
Steps to reproduce:
1) Attempt to handcraft multiple items (craft 5 or craft all) that only have a partial change of success (largely the production scrap mod)
2) If doing craft 5, have just enough items for 5 (craft all will use all possible items, so this step doesn't apply)
3) The game will internally figure out how many will succeed, and when an intermediate product fails, will add another craft (I'm guessing a bit on this step)
4) When the internal "add another craft" occurs, and you don't have any more items in your inventory, this will happen
5) Note that this doesn't happen every time, since it is related to probabilities
What I expect to happen:
If the craft fails, then simply don't craft it (for the craft 5, you get less than 5; for the craft all, you just get less).
What actually happens:
You get a near infinite amount. I see 4.2G, which I think is 4.2 billion, which I believe is the max value of an unsigned 32 bit integer. I suspect there is an overflow (or rather underflow) issue.
The attachment show me attempting to craft 5 filter inserters, which have an intermediate craft of a fast inserter. You can see the 4.2G fast inserters in the handcraft queue. I definitely do not have the required billions of iron, circuits, or inserters to do this.
Steps to reproduce:
1) Attempt to handcraft multiple items (craft 5 or craft all) that only have a partial change of success (largely the production scrap mod)
2) If doing craft 5, have just enough items for 5 (craft all will use all possible items, so this step doesn't apply)
3) The game will internally figure out how many will succeed, and when an intermediate product fails, will add another craft (I'm guessing a bit on this step)
4) When the internal "add another craft" occurs, and you don't have any more items in your inventory, this will happen
5) Note that this doesn't happen every time, since it is related to probabilities
What I expect to happen:
If the craft fails, then simply don't craft it (for the craft 5, you get less than 5; for the craft all, you just get less).
What actually happens:
You get a near infinite amount. I see 4.2G, which I think is 4.2 billion, which I believe is the max value of an unsigned 32 bit integer. I suspect there is an overflow (or rather underflow) issue.
The attachment show me attempting to craft 5 filter inserters, which have an intermediate craft of a fast inserter. You can see the 4.2G fast inserters in the handcraft queue. I definitely do not have the required billions of iron, circuits, or inserters to do this.