[0.15.12] Find_entities_filtered does not find fire or smoke

Bugs that are actually features.
Post Reply
SilverB1rd
Inserter
Inserter
Posts: 47
Joined: Fri Mar 17, 2017 9:19 pm
Contact:

[0.15.12] Find_entities_filtered does not find fire or smoke

Post by SilverB1rd »

This code will return fire and smoke entities when they are within the search area

Code: Select all

local pos = entity.position
			local size = 5
			local area = {{pos.x -size, pos.y-size},{pos.x +size, pos.y+size}}
			local flames = entity.surface.find_entities(area)
			for _, f in pairs(flames) do
				log(f.type)
			end
This code does not return fire or smoke elements.

Code: Select all

local flames = surface.find_entities_filtered{position = entity.position, area = {{-5,-5}, {5,5}}}
			for _, f in pairs(flames) do
				log(f.type)
			end
Adding the type="fire" does not change the results.

Expected result:
find_entities_filtered should be able to find fire and smoke elements.

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

Re: [0.15.12] Find_entities_filtered does not find fire or smoke

Post by Rseding91 »

You've defined position and area and the game uses position over area so it's searching the exact position.

Position based search doesn't find zero-bounding box sized entities so it doesn't show up.
If you want to get ahold of me I'm almost always on Discord.

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [0.15.12] Find_entities_filtered does not find fire or smoke

Post by Nexela »

You've defined position and area and the game uses position over area so it's searching the exact position.

Position based search doesn't find zero-bounding box sized entities so it doesn't show up.
Rseding Can you add that as a note on http://lua-api.factorio.com/latest/LuaS ... s_filtered?

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

Re: [0.15.12] Find_entities_filtered does not find fire or smoke

Post by Rseding91 »

Yeah I'll do that.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”