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

Post Reply
jurgy
Burner Inserter
Burner Inserter
Posts: 7
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"},
})

Rseding91
Factorio Staff
Factorio Staff
Posts: 13327
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post by Rseding91 »

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.

Post Reply

Return to “Fixed for 2.0”