[0.18.32] entity.fluidbox.get_prototype(index) reading assembler prototype but limiting index to amount of compound flui

Post your bugs and problems so we can fix them.
Post Reply
theawesomeawe1
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Jun 23, 2020 5:26 am
Contact:

[0.18.32] entity.fluidbox.get_prototype(index) reading assembler prototype but limiting index to amount of compound flui

Post by theawesomeawe1 »

entity.fluidbox.get_prototype(index) should return the fluidbox prototype used by the fluidbox that can be accessed by entity.fluidbox[index]. Instead, it returns the nth entity prototype's fluidbox definition (eg, if index = 1, then it returns the first fluidbox defined in the entity prototype). However, it is still limited by the number of fluidboxes actually present in game, given by #entity.fluidbox, which for all vanilla assembler recipes, is less than the number of fluidbox prototypes.

Steps to recreate: place an assembling-machine-3, set it's recipe to fill lubricate barrel, hover over it, and execute:

/c local ent = game.player.selected
game.print(ent.fluidbox.get_prototype(1).production_type)

The string printed is "input"

Change assembler's recipe to "empty lubricant barrel" and execute the same code again.

The string printed is still "input", even though the empty barrel recipe uses the output fluidbox of the assembling-machine-3 prototype.

In both cases, "ent.fluidbox.get_prototype(2).production_type" gives an error because in "get_prototype(2)" the 2 is out of bounds as the assembler's #entity.fluidbox is 1.

What I expect to happen: "get_prototype(index)" should return the prototype used by the fluidbox referenced by "fluidbox[index]"

Post Reply

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users