[Rseding91] Inventory.insert doesn't care about filtered slots in assemb
Posted: Tue Oct 27, 2015 5:22 pm
Hi,
while developing a mod I discovered that inventory.insert used on assembling machines doesn't respect the filtered slots.
So for example: When I add iron-plates into a entity of type assembling-machine they will always go in. Even when the recipe doesn't even need iron-plates.
I found this on 0.12.12 and retested it successfully in 0.12.14.
Command used to add items into the inventory of the assembling machine:
/c game.player.print(serpent.block(game.player.selected.get_inventory(defines.inventory.assembling_machine_input).insert{name="iron-plate",count=3}))
/edit:
The same goes for the can_insert command:
/c game.player.print(serpent.block(game.player.selected.get_inventory(2).can_insert{name="iron-plate",count=3}))
This will for example return true when you hover an assembling machine which produces stone-furnaces (which only require stone)
See this screenshot: Thanks for having a look at this.
Best,
judos
while developing a mod I discovered that inventory.insert used on assembling machines doesn't respect the filtered slots.
So for example: When I add iron-plates into a entity of type assembling-machine they will always go in. Even when the recipe doesn't even need iron-plates.
I found this on 0.12.12 and retested it successfully in 0.12.14.
Command used to add items into the inventory of the assembling machine:
/c game.player.print(serpent.block(game.player.selected.get_inventory(defines.inventory.assembling_machine_input).insert{name="iron-plate",count=3}))
/edit:
The same goes for the can_insert command:
/c game.player.print(serpent.block(game.player.selected.get_inventory(2).can_insert{name="iron-plate",count=3}))
This will for example return true when you hover an assembling machine which produces stone-furnaces (which only require stone)
See this screenshot: Thanks for having a look at this.
Best,
judos