Inventory indices/defines
Posted: Wed Jun 01, 2022 4:48 pm
https://lua-api.factorio.com/latest/Lua ... _inventory
I feel as though the actual return result should be clarified better. This makes a difference, especially with other commands like .mine{}, which will behave differently if the inventory parameter is left blank/fed "nil" vs... whatever that actual result above is.
Edit: Ok, sorry, it seems that no matter what I give it, it returns with the chest's inventory? I'm confused now.
I may be incorrect in my thinking, but this led me to believe that calling ".get_inventory(defines.inventory.character_main)" on say, a steel-chest, would give me an actual nil result. Instead, with serpent.block(), I get this:Return values
:: LuaInventory?
The inventory or nil if none with the given index was found.
Code: Select all
{
{
__self = "userdata"
},
{
__self = 0
},
{
__self = 0
},
[...]
-- repeats 44 more times
[...]
{
__self = 0
},
__self = 0
}
Edit: Ok, sorry, it seems that no matter what I give it, it returns with the chest's inventory? I'm confused now.
