Page 1 of 1

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

Posted: Sat May 11, 2024 9:30 am
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"},
})

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

Posted: Tue Jul 23, 2024 8:51 pm
by Rseding91
Thanks for the report. This is now fixed for 2.0.