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"},
})
[1.1.107] LuaPlayerBuiltEntityEventFilter ghost_name for tiles not the name of the underlying tile prototype
Re: [1.1.107] LuaPlayerBuiltEntityEventFilter ghost_name for tiles not the name of the underlying tile prototype
Thanks for the report. This is now fixed for 2.0.
If you want to get ahold of me I'm almost always on Discord.