-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2 - calculateNextStation - Index out of Bounds exception #65
Comments
Potential fix implemented and now available on the v2-dev branch. Feel free to retest / verify but you will need to manually compile the code. |
Nope, still getting the error, I'm pretty sure I know how to fix it. I'll make a PR for this tomorrow. Pretty sure there is a easy fix of just returning the first stop like you did, but I would like to see if I can get a good way to calculate the closest selected stop and return that instead.
It is also adding unselected stations in the log at least, might just be its not able to cleanup from the exception though. The next test I did this
Then tried with just topton, rhodo and andrews but got this in the log
Another bug now, if you run a train with the engine facing "west" it starts acting very oddly. Thinking its at the end of the line before it should etc. My guess is when it does the direction check and flips Similar to the first part, I'll make another PR for this part tomorrow. |
I always toss any behavior after an exception out as at that point garbage in garbage out. There is something I am doing differently that I am just not seeing this crash. Once I have some dinner I will spend some time in game trying to get this to crash in this manner. As for the direction that is something I have known about for some time. I had planned to address this when I rewrite the portion of code handling the direction changes in the auto-engineer class as that part of the code is relatively untouched and still needs some attention. |
Appears my testing was flawed. I have reproduced now. |
Just made a PR for fixing everything but the East/West issue. The odd behavior with unselected stations was due to |
Merged but made adjustments to select the closest station. When traveling eastward the furthest station would be selected instead of the closest of the selected stations. Please test the adjustments and if everything still checks out we can consider this closed. Thanks! |
Just tested and it works and this can be closed. I am going to add something to calculate the closest selected station, figure that is a better solution rather than sending the train all the way to one of the two endpoints |
Might be an issue on the live build, have not tested it.
The text was updated successfully, but these errors were encountered: