PC Possible Train Code Bug

Prsim 99

Sodbuster
While working on a mod I noticed that the value of the variable trainTimer in the class Railroad.cs can go to -8 while counting down. The code to start the train looks for trainTime <=0, which works fine and the train appears. However, nothing sets the value to 0 and the code to launch the next train in updateEvenIfFarmerIsntHere checks for trainTimer == 0. I did a decompile and added a couple log lines and the "vanilla" version with logging still goes to -8 even without SMAPI and once the first train passes no other train will appear until the game is reloaded. Possibly a bug?
 
Top