[0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

This subforum contains all the issues which we already resolved.
User avatar
AmatorPhasma
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Aug 05, 2017 8:20 pm
Contact:

[0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

Post by AmatorPhasma »

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.

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
Attachments
inserter_test.zip
save for testing
(2.35 MiB) Downloaded 159 times
what happens...
what happens...
inserter.gif (3.93 MiB) Viewed 3897 times
Rseding91
Factorio Staff
Factorio Staff
Posts: 14412
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

Post by Rseding91 »

Thanks for the report however I have no idea what you're actually trying to report.

Can you please explain what you expect to happen and what is currently happening?
If you want to get ahold of me I'm almost always on Discord.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

Post by orzelek »

Rseding91 wrote: Mon Dec 16, 2019 6:25 pm Thanks for the report however I have no idea what you're actually trying to report.

Can you please explain what you expect to happen and what is currently happening?
I think it's the fact that inserter is given stack of 3 items by script but drops only one first then other two on next swing.
User avatar
AmatorPhasma
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Aug 05, 2017 8:20 pm
Contact:

Re: [0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

Post by AmatorPhasma »

Rseding91 wrote: Mon Dec 16, 2019 6:25 pm Thanks for the report however I have no idea what you're actually trying to report.

Can you please explain what you expect to happen and what is currently happening?
What I expect:
if I give a normal inserter an item stack with size 3 (example: coal) in the hand it lays them down on the belt, like if he put them from a chest or crafting-machine.

What happend:
It lay only one item from this item stack with size 3 on the belt, then go back and forth and lay the other two.
User avatar
AmatorPhasma
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Aug 05, 2017 8:20 pm
Contact:

Re: [0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

Post by AmatorPhasma »

orzelek wrote: Mon Dec 16, 2019 6:40 pm
Rseding91 wrote: Mon Dec 16, 2019 6:25 pm Thanks for the report however I have no idea what you're actually trying to report.

Can you please explain what you expect to happen and what is currently happening?
I think it's the fact that inserter is given stack of 3 items by script but drops only one first then other two on next swing.
exactly, and it does this only if the item stack has the maximum size of 1+stack bonus for this type of inserter.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14412
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

Post by Rseding91 »

Ok, I was able to reproduce it and it's now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
User avatar
AmatorPhasma
Fast Inserter
Fast Inserter
Posts: 126
Joined: Sat Aug 05, 2017 8:20 pm
Contact:

Re: [0.17.79] inserter.held_stack.transfer_stack() unexpected behavior on transport belts

Post by AmatorPhasma »

Rseding91 wrote: Mon Dec 16, 2019 6:49 pm Ok, I was able to reproduce it and it's now fixed for the next release.
That was a fast one :P
Thank you very much! :)
Post Reply

Return to “Resolved Problems and Bugs”