Description
A stack loader fails to output a full stack onto the belt if the last slot in the source chest contains fewer items than the full stack size. For example, if a chest contains 201 items of an item with a stack size of 200, the loader will only place one item on the belt instead of a full stack. Example:Steps to reproduce
1. Create a stack loader with a specific max_belt_stack_size (e.g.: data.raw["loader"]["express-loader"].max_belt_stack_size = 4)2. Set the belt stack size bonus greater than zero (e.g., via console: /c game.forces["player"].belt_stack_size_bonus = 3)
3. Place the loader to unload from a chest containing 201 items.
Expected result: The loader should place a full stack onto the belt.
Actual result: The loader places only a single item onto the belt.
This is an extreme example and guarantees an unstacked belt. However, in real gameplay scenarios, this bug leads to irregular stacking on the belt, where some items appear with stack sizes of only 1–3, causing noticeable "gaps".