[0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts
Posted: Mon Dec 16, 2019 4:08 pm
				
				Hi,
I think I found a bug again 
 
What?
If I give an Inserter with the drop_target of the type: transport-belt, underground-belt or splitter a item stack in the hand by script or console. it has a unexpected behavior as you can see in the attached gif.
Reproduce
- Load the attached save
- execute the following command in the console:
Info
- This only happens if the stack size is equal to (and only than): 1 + force.inserter_stack_size_bonus (like shown in the tooltip)
What I expect?
- like if it has an item stack with size < 1 + force.inserter_stack_size_bonus, wait until the last item is on the belt.
			I think I found a bug again
 
 What?
If I give an Inserter with the drop_target of the type: transport-belt, underground-belt or splitter a item stack in the hand by script or console. it has a unexpected behavior as you can see in the attached gif.
Reproduce
- Load the attached save
- execute the following command in the console:
Info
- This only happens if the stack size is equal to (and only than): 1 + force.inserter_stack_size_bonus (like shown in the tooltip)
What I expect?
- like if it has an item stack with size < 1 + force.inserter_stack_size_bonus, wait until the last item is on the belt.
Code: Select all
/c
local surface = game.surfaces[1]
local inserters = surface.find_entities_filtered({type='inserter'})
local item_stack = {name = 'coal', count = 3}
for _, inserter in pairs(inserters) do
    if inserter.unit_number == 96 then
        if inserter.drop_target then
             if not inserter.held_stack.valid_for_read then
                 if inserter.held_stack.can_set_stack(item_stack) then
                     inserter.held_stack.transfer_stack(item_stack)
                 end
            end
        end
    end
end

