Therefore, the correct way to update a fluidbox of an entity is to read it first, modify the table, then write the modified table back
Code: Select all
fluid = entity.fluidbox[1]
fluid.temperature = fluid.temperature * 2
entity.fluidbox[1] = fluidFor example run this code on a fluid segment with just two storage tanks, both full with 25k. So the full fluid segment has 50k.
Code: Select all
entity = game.player.selected
fluid = entity.fluidbox[1]
game.print(fluid.amount)
entity.fluidbox[1] = fluid
game.print(entity.fluidbox[1].amount)I expect reading and writing to be consistent. So either the amount when reading is from the whole network, or (preferably) when writing sets it only to the entity the fluidbox belongs to (and then immediately equalises it amongst the rest of the fluid segment).
