Page 1 of 1

Passing 0 precision to find_non_colliding_position() gives infinite loop

Posted: Sat Nov 03, 2018 10:59 pm
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.

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

Posted: Wed Nov 07, 2018 10:11 am
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...).