Passing 0 precision to find_non_colliding_position() gives infinite loop

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Therax
Filter Inserter
Filter Inserter
Posts: 470
Joined: Sun May 21, 2017 6:28 pm
Contact:

Passing 0 precision to find_non_colliding_position() gives infinite loop

Post by Therax »

Code: Select all

game.print(game.player.surface.find_non_colliding_position("player", game.player.position, 2, 0))
This is definitely a case of a mod bug, but it probably should result in an error instead of a hung process. I stumbled across this when I got the parameter order for radius (0=infinite radius) and precision (0 step size = probe the same position forever) reversed.
Miniloader — UPS-friendly 1x1 loaders
Bulk Rail Loaders — Rapid train loading and unloading
Beltlayer & Pipelayer — Route items and fluids freely underground

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: Passing 0 precision to find_non_colliding_position() gives infinite loop

Post by Klonan »

In 0.17, it will enforce a minimum value of 0.01, so it shouldn't get stuck (though it might take some time...).

Post Reply

Return to “Resolved Problems and Bugs”