[Solved] Filter entities : add shortcut for single tile area
Posted: Wed Jan 30, 2019 11:19 am
Hello,
Just a little suggestion, it is not possible to use find_entities_filtered with an area of one tile, for example:
gives me this error: "An area of zero size is not supported. Either don't define area to search the entire surface, or use 'position'"
In case of 1 tile area, the function should fallback itself to the use of 'position' and transform my code into:
My use case is that I'm in on_player_built_tile event, and I can receive a single tile square if I pressed "minus" to reduce the tile drawing box to 1x1 square. I can do this job myself, but I think it should be handled by the find_entities_filtered method.
Regards,
Just a little suggestion, it is not possible to use find_entities_filtered with an area of one tile, for example:
Code: Select all
game.surfaces[1].find_entities_filtered{
area = {{-17.5,-5.5}, {-17.5,-5.5}}
}
In case of 1 tile area, the function should fallback itself to the use of 'position' and transform my code into:
Code: Select all
game.surfaces[1].find_entities_filtered{
position= {-17.5,-5.5}
}
Regards,