Step 1: Start a vanilla freeplay. Or put an item other than copper plate into the first slot of your inventory.
Step 2: Run this command: /c game.player.print(game.player.character.get_inventory(defines.inventory.player_main).set_filter(1,"copper-plate"))
What I expected to happen: A printout "false" because the content of the first slot of the inventory collides with the filter it would set.
What happens: A filter is set under the item in the inventory. The next time I remove the item, I can't put it back because of the filter even though the hand still shows up.
[0.17.8] LuaInventory.set_filter sets the filter even if a different type of item is in that slot.
Re: [0.17.8] LuaInventory.set_filter sets the filter even if a different type of item is in that slot.
The same is the case with "can_set_filter".
Running...
/c game.player.print(game.player.character.get_inventory(defines.inventory.player_main).can_set_filter(1,"copper-plate"))
...still prints out true even if there is an item of a different type in that slot.
Running...
/c game.player.print(game.player.character.get_inventory(defines.inventory.player_main).can_set_filter(1,"copper-plate"))
...still prints out true even if there is an item of a different type in that slot.
Re: [0.17.8] LuaInventory.set_filter sets the filter even if a different type of item is in that slot.
Thanks for the report however this is working correctly: the filter can be set regardless of what item is in the slot.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.17.8] LuaInventory.set_filter sets the filter even if a different type of item is in that slot.
This used to work differently...
Under what conditions would the methods return false?
And what's the point of the item parameter in can_set_filter?
Under what conditions would the methods return false?
And what's the point of the item parameter in can_set_filter?
Re: [0.17.8] LuaInventory.set_filter sets the filter even if a different type of item is in that slot.
Mainly for ammo/weapon inventories.
If you want to get ahold of me I'm almost always on Discord.