Complex generator stuck in infinite loop while adding extra connections between existing rails
When using the complex rail generator, some input configs give the generator a hard time to find a solution (that's ok).
The complex rail generator handles this with a limit sanity_max = 9000 that should limit the number of attempts before giving up. sanity_max acts as an upper bound to the variable created_sanity.
Problem:
In the second part of the generation, when the generator attempts to add extra connections between rails, the variable created_sanity is never incremented. The while loop condition reated_sanity < sanity_max is never met and the generator can - and sometimes does - loop indefinitely
Edited by thomaslecat