[2.0.13] Stack inserter stuck grabbing from mixed belt (MR)
Posted: Thu Oct 31, 2024 3:38 pm
For a normal inserter, they move all the items into machines, but for stack-inserter, things become different.
When the belt has 2 different items (with limit 4+16 = 19 for example). And thus the machine accept at most 4+max_stack items.
For stack-inserters, it will grab exact 16 items, but in case machine has more than 4 of item 1, the condition `(item 1's count) < 4 + max_stack` still holds, thus the stack-inserter will still grab item1.
The problem is that, if item 2 is used out, but item 1 have the count more than 4, the stack inserter will grab at most `max_stack + 4 - (item 1's count) < 16` items, then stuck since it cannot grab more items since it will exceed the 4+max_stack limit, and thus it cannot put all the items into the machine (since it cannot grab 16 items.)
This thing is tested under [2.0.12] and [2.0.13], which prevent using stack inserter for a mixed belt.
(Cannot really reproduce it under a small blueprint, but it could be easily triggered by put extra items into the machine)
When the belt has 2 different items (with limit 4+16 = 19 for example). And thus the machine accept at most 4+max_stack items.
For stack-inserters, it will grab exact 16 items, but in case machine has more than 4 of item 1, the condition `(item 1's count) < 4 + max_stack` still holds, thus the stack-inserter will still grab item1.
The problem is that, if item 2 is used out, but item 1 have the count more than 4, the stack inserter will grab at most `max_stack + 4 - (item 1's count) < 16` items, then stuck since it cannot grab more items since it will exceed the 4+max_stack limit, and thus it cannot put all the items into the machine (since it cannot grab 16 items.)
This thing is tested under [2.0.12] and [2.0.13], which prevent using stack inserter for a mixed belt.
(Cannot really reproduce it under a small blueprint, but it could be easily triggered by put extra items into the machine)