[2.0.23] entity.get_filter(1) on storage-chest gets prototype

Post your bugs and problems so we can fix them.
User avatar
gangerM
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Nov 28, 2024 5:32 pm
Contact:

[2.0.23] entity.get_filter(1) on storage-chest gets prototype

Post by gangerM »

I made a mod to expand filters and therefore add functionality to copy/paste. The code below is a MWE to reproduce the issue:

Code: Select all

data:extend{{
    type = "custom-input",
    name = "FolterCopyExpansion_Copy",
    key_sequence = "mouse-button-2 + SHIFT",
    linked_game_control = "copy-entity-settings",
    action = "lua",
    include_selected_prototype=true,
}}

Code: Select all

local CopyFrom = player.selected
    if CopyFrom then
        if CopyFrom.name:lower() == "storage-chest" then
            local Filter = CopyFrom.get_filter(1) -- gets prototype filter
        elseif CopyFrom.type:lower():match("inserter") then
            local Filter = CopyFrom.get_filter(1) -- gets a normal filter
        end
    end
I think it is a bug, as it is inconsistent for the same function.
I would expect both cases to give the normal filter, not a prototype. If I see something wrong here please let me know as well as this is my first mod in the making.
Edit: it is specifically the name of the filter that is a prototype, I realized this was not clear in my original post.
Post Reply

Return to “Bug Reports”