Page 1 of 1

[2.0.58] Crash with surface.find_entities_filtered radius infinite

Posted: Thu Jun 26, 2025 11:53 am
by Theis
What happened
Factorio crashes on <surface>.find_entities_filtered with absurdly large radius value.
How to reproduce
Run this command in the console

Code: Select all

/c game.surfaces[1].find_entities_filtered{position = {0,0}, radius = 1.7976931348623e+308}
Why did i try this
I have a script for finding entities within the reach of the player. However when switching to remote view, the value of player.resource_reach_distance is 1.7976931348623e+308, which makes the function crash Factorio.
Lower values such as 1.7976931348623e+288 doesn't crash the game.

Re: [2.0.58] Crash with surface.find_entities_filtered radius infinite

Posted: Thu Jun 26, 2025 3:01 pm
by Rseding91
Thanks for the report. In this specific case, there's not a lot of "better" by fixing this - it simply doesn't crash anymore. You really never want to give big values to the radius parameter because the performance scales terribly.