Flamethrower turret #fluidbox == 2 but crashes on .get_filter(2)
Posted: Mon Jan 22, 2024 7:33 pm
The prototype has 1 fluid box, while in game 2 are visible when printed. However, .get_filter(2) crashes
While running this code from a mod I am developing:
The last line crashes with this log output:
I was informed there is an edge case with .get_filter() with flamethrower turrets, and to report it here.
While running this code from a mod I am developing:
Code: Select all
local fb = entity.fluidbox
for i = 1, #fb do
log(entity.name .. " " .. #fb .. " " .. i)
local filter = fb.get_filter(i)
...
Code: Select all
24.984 Script @__fluid-connection-indicators__/control.lua:85: flamethrower-turret 2 1
24.984 Script @__fluid-connection-indicators__/control.lua:85: flamethrower-turret 2 2
24.993 Error MainLoop.cpp:1391: Exception at tick 1105: The mod Fluid Connection Indicators (0.1.2) caused a non-recoverable error.
Please report this error to the mod author.
Error while running event fluid-connection-indicators::on_built_entity (ID 6)
Passed index is out of range.
stack traceback:
[C]: in function 'get_filter'
__fluid-connection-indicators__/control.lua:86: in function 'update_entity'
__fluid-connection-indicators__/control.lua:115: in function <__fluid-connection-indicators__/control.lua:109>