Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Crash when Resource is not set and Circuits are used #36
I have encountered a crash repeatably while designing a train station using this mod. The crash occurs in or near the same tick as the train stop being "Enabled" via circuit condition. I have not been able to reproduce this in a minimal save file (using less mods). The crash can be reproduced by placing an additional 100 "Speed Module 8" (available in the character's inventory) into either of the two chests to the East of the character (attached to the stop known as
The exact error message produced is:
The crash does not occur if there is a "Resource" set in the attached Train Stop Supplier. It also does not occur if all of the circuits are disconnected from the Train Stop. Notably, this is happening with the stop in the not-Enabled state.
Looking at the code in question (https://github.com/kiasyn/SamTrain/blob/master/src/scripts/conductor.lua#L35), it looks like the
Thanks for looking! I am really enjoying this mod. It is proving much simpler to implement round-robin train logic than trying to do it with Circuit conditions alone. ;-)
Glad to help! The test build did not crash under the same conditions, so the fix works. I will probably find more small problems through the course of this week. I am relatively new to Lua API modding or I would have submitted a Pull Request myself. I'll see what else happens over the course of this week as I work on this new map (still Sunday night for me! Few more hours of freedom!). Thanks again, I am amazed at the quick response!