Packing Tape


Mining a chest allows players to pick it up with all the items inside and carry it in their inventory. Also supports vehicles, tanks, and accumulators.

Content
2 months ago
0.17 - 2.0
13.0K
Storage

b Crash when using logistic request sections

2 months ago

When using a named logistic request section, unpacking a packed vehicle causes the following crash:

Error while running event packing-tape::on_built_entity (ID 6)
'filters': table expected, got string
stack traceback:
[C]: in function 'newindex'
__packing-tape
/control.lua:140: in function 'set_requester_data'
packing-tape/control.lua:424: in function 'unpack_entity'
packing-tape/control.lua:457: in function <packing-tape/control.lua:452>

I already checked it out, you already added support for that but it seems that you accidentally forgot to put "string" in quotation marks and compared it to the library instead, in the line with "type(section_data) == string"

local function set_requester_data(entity, requests)
    local logistic_point = entity.get_requester_point()
    if not logistic_point then return end
    if logistic_point.sections_count > 0 then
        logistic_point.remove_section(logistic_point.sections_count)
    end
    for index, section_data in pairs(requests) do
        if type(section_data) == string then
            logistic_point.add_section(section_data)
        else
            game.print(section_data)
            game.print(type(section_data))
            logistic_point.add_section().filters = section_data
        end
    end
end
2 months ago

Hey it's me again, after my fix it turns out, that the requests duplicate with every packing operation (At least it does for vehicles).

It seems that in vanilla, vehicles now store their logistic requests, so there is not need for this mod to handle it for that entity type.
Turning off the mod entirely persists the requests just fine.

2 months ago

Thanks, I've fixed both issues.

New response