[2.0.58] Crash with surface.find_entities_filtered radius infinite

This subforum contains all the issues which we already resolved.
Theis
Inserter
Inserter
Posts: 35
Joined: Tue Sep 13, 2022 9:57 am
Contact:

[2.0.58] Crash with surface.find_entities_filtered radius infinite

Post 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.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15837
Joined: Wed Jun 11, 2014 5:23 am
Contact:

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

Post 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.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”