[.15.9] luaItemStack.active_index using 0 based index

This subforum contains all the issues which we already resolved.
Post Reply
Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

[.15.9] luaItemStack.active_index using 0 based index

Post by Nexela »

Holding a BP book with a few BPs in it with the first bp as the active bp and running this command results in inventory out of bounds error, adding 1 to the active index returns the correct index
/c game.print(game.player.cursor_stack.get_inventory(defines.inventory.item_main)[game.player.cursor_stack.active_index].name)

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [.15.9] luaItemStack.active_index using 0 based index

Post by Rseding91 »

This seems to be a recurring problem :D We develop with 0-based indexing and then forget to convert to 1-based for the API.

Anyway, fixed for 0.15.10.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”