Is LuaSimulation.get_slot_position supposed to be 0-based?

i142857
Inserter
Inserter
Posts: 24
Joined: Mon Nov 04, 2024 9:56 am
Contact:

Is LuaSimulation.get_slot_position supposed to be 0-based?

Post by i142857 »

LuaSimulation.get_slot_position takes a slot_index. The game interprets this as 0-based (i.e. the first slot in the inventory is slot_index 0). It means it's inconsistent with functions like LuaInventory.find_item_stack which returns a 1-based stack index.

Intentional? If yes, please document as hardly anything in the whole API is 0-based. If no, please fix (although, arguably, that might break mods if they depended on the old behavior!)
User avatar
Therenas
Factorio Staff
Factorio Staff
Posts: 325
Joined: Tue Dec 11, 2018 2:10 pm
Contact:

Re: Is LuaSimulation.get_slot_position supposed to be 0-based?

Post by Therenas »

Thanks, this is noted for the next release.
Post Reply

Return to “Resolved Requests”