[1.1.107] LuaPlayerBuiltEntityEventFilter ghost_name for tiles not the name of the underlying tile prototype

Post your bugs and problems so we can fix them.
Post Reply
jurgy
Burner Inserter
Burner Inserter
Posts: 6
Joined: Wed Feb 27, 2019 5:55 pm
Contact:

[1.1.107] LuaPlayerBuiltEntityEventFilter ghost_name for tiles not the name of the underlying tile prototype

Post by jurgy »

I was working on filtering my events instead of checking inside the event, and noticed that in the on_built_entity event "event.ghost_name" is equal to the name underlying type, even for tiles, but when I added the filtering to the on_event, my event stopped working.

After some digging around, I noticed that in the filter for tiles "ghost_name" and "name" had the same value: "tile-ghost" instead of one having that value and the other being the name of the underlying prototype such as "refined-concrete"

Reproduction:

-- Doesn't work:
script.on_event(defines.events.on_built_entity, my_entity_built_event, {
{filter = "type", type = "tile-ghost"},
{filter = "ghost_name", name = "refined-concrete" , mode = "and"},
})

-- Does work:
script.on_event(defines.events.on_built_entity, my_entity_built_event, {
{filter = "type", type = "tile-ghost"},
{filter = "ghost_name", name = "tile-ghost" , mode = "and"},
})

-- Also works and shows the equality of the two fields:
script.on_event(defines.events.on_built_entity, my_entity_built_event, {
{filter = "type", type = "tile-ghost"},
{filter = "ghost_name", name = "tile-ghost" , mode = "and"},
{filter = "name", name = "tile-ghost" , mode = "and"},
})

Post Reply

Return to “Bug Reports”