[1.1.109] LuaSurface.create_entity uses 0 based indexing for the "bar"

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
Atria
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Jul 09, 2016 10:25 am
Contact:

[1.1.109] LuaSurface.create_entity uses 0 based indexing for the "bar"

Post by Atria »

When I create entity (specifically a chest) with LuaSurface.create_entity I can provide "bar" parameter which will be used to set bar of a chest.

But this "bar" is treated as zero-based index, instead of 1-based index as all other method which work with inventory bar

Code: Select all

-- setting "bar" to 10, so only first row should be allowed
-- but "get_bar" function returns 11
surface.create_entity({name = 'iron-chest', bar = 10}).get_inventory(defines.inventory.chest).get_bar()

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

Re: [1.1.109] LuaSurface.create_entity uses 0 based indexing for the "bar"

Post by Rseding91 »

Well, that's annoying. It turns out all blueprint strings share this same Lua API. So if I "fix" it for create_entity every single blueprint string will be broken. It's going to need some more thinking.
If you want to get ahold of me I'm almost always on Discord.

Atria
Long Handed Inserter
Long Handed Inserter
Posts: 60
Joined: Sat Jul 09, 2016 10:25 am
Contact:

Re: [1.1.109] LuaSurface.create_entity uses 0 based indexing for the "bar"

Post by Atria »

Plus breaking use of LuaSurface.create_entity in all existing mods which use bar. But to be fair it's probably not that common

Post Reply

Return to “Minor issues”