Page 1 of 1

[Rseding91] [1.1.57] Items inside modded item-with-inventory incompatible with hotbar when 0 of that item in inventory

Posted: Mon Apr 11, 2022 2:40 pm
by Hanakocz
Heya,
I tried to make simple filtered bag

Code: Select all

data:extend
{{
    name = 'weapon-bag',
    type = 'item-with-inventory',
    inventory_size = 10,
    icons = Lib.icons('weapon-bag'),
    stack_size = 1,
    item_subgroup_filters = item_subgroup_filters,
    filter_mode = 'whitelist',
    extends_inventory_by_default = true,
    insertion_priority_mode = 'default'
}}
It works as expected from documentation - it is openable, filterable, collects filtered items automatically.

However there is one issue, if you have item in hotbar, it shows total amount of available items from your inventory and from the bag. When you click the item in hotbar, it takes full stack of the item into cursor, and it prioritizes taking items from the bag. When items are removed from cursor (Q), they return to bag. However, this works only when you have at least one same item in the main inventory. If all the items are in bag only, clicking on them at hotbar does nothing even though it shows you have enough of the items.

I would expect that I can use items from extended inventories, regardless if I have that item *also* in the main inventory, especially when the default behaviour is that all collected items go into the bag first, so main inventory usually will have none of the items.

As a bonus note, taking the items directly from bag still makes reservation on that slot (hand in slot), however when pressing Q, error is thrown that items can't be returned. Then hand disappears and repeated Q press drops the items into the bag (as it collects items first because of the filters)
Factorio 2022.04.11 - 16.35.26.02.mp4
(13.73 MiB) Downloaded 152 times
Video: clicking on hotbar, dropping items back by pressing Q.

Re: [Rseding91] [1.1.57] Items inside modded item-with-inventory incompatible with hotbar when 0 of that item in invento

Posted: Tue Apr 19, 2022 6:56 pm
by Rseding91
Thanks for the report. It's now fixed for the next release.