[0.17.76] set_blueprint_entities() removes logistic request filters from infinity logistic containers
Posted: Wed Nov 13, 2019 9:25 pm
Hello, this is a bit of an obscure bug that one of the users of my mod ran across. Take a look at this block of code:
This code causes the issue. As you can see, all the code is doing (after making sure the blueprint item is actually valid) is getting the blueprint entities, then setting those entities back into the blueprint. It is not modifying them whatsoever. I even had serpent print the entities table and the logistic request filters are in there! However, it appears that set_blueprint_entities() is destroying them.
See this demonstration:
This demo only shows an infinity buffer chest, but it happens to infinity storage and requester chests too. Regular (non-infinity) logistic containers are unaffected by this issue.
Code: Select all
script.on_event(defines.events.on_player_setup_blueprint, function(e)
local player = game.players[e.player_index]
local bp = player.blueprint_to_setup
if not bp or not bp.valid_for_read then
bp = player.cursor_stack
end
local entities = bp.get_blueprint_entities()
if not entities then return end
bp.set_blueprint_entities(entities)
end)
See this demonstration:
This demo only shows an infinity buffer chest, but it happens to infinity storage and requester chests too. Regular (non-infinity) logistic containers are unaffected by this issue.