shanemadden / factorio-deadlock-beltboxes-loaders

Other
8 stars 16 forks source link

Auto unstacking when the player holds a partial stack of stacked items in the cursor slot, and no other stacks in the bag #13

Open Mernom opened 4 years ago

Mernom commented 4 years ago

When the player holds a partial stack of stacked items in the cursor slot and picks up stacked items from the same type (while having no other stacked items of that type in the bag), the auto unstacking script will fail to remove the newly picked up items, while succeeding in inserting the unstacked items.

This allows for item duplication, by using Z on top of yourself while also holding F to pick the dropped item up.

Deadlock989 commented 3 years ago

I recommend removing or commenting out ownlyme's auto-unstacking code if no-one can see a good fix for this - I can't.

Mernom commented 3 years ago

It doesn't seem to hard to fix - add an optional last parameter for 'inventory to insert to', for when it's not identical to the 'inventory to remove from', and then check if there are any stacks of the stacked item in the main inventory. If there's not, and there are in the cursor inventory, remove from the cursor inventory, and insert into the bag inventory.

I can try wringing that part.