Code: Select all
local path = self.ent.surface.find_entities_filtered{position=self.ent.position, type="resource", limit=1}
Code: Select all
Find entities of given type or name in a given area.
If no filters (name, type, or force) are given, returns all entities in the search area. If multiple filters are specified, returns only entities matching all given filters.
If no area and no position are given, then the entire surface is searched. If both area and position are specified, returns only entities matching the position. If position and radius are given, returns only entities within that radius of the position.
It is a bit pedantic, but can a clarification be given as to whether this behavior is reliable?