Caused by timetable.getCondition() returning a -1 error code instead of a table,
and then timetable_gui attempts to unwrap using the lua pairs() function but fails as pairs requires table as a parameter, not a number
The cause us likely due to a line or station being deleted at the same time as the timetable window is opened, or another similarly rare event.
The fix for this issue is to ensure that errors are handled gracefully throughout timetable_gui.
Also note that clearConstraintWindowLaterHACK was the calling function to this, and should probably be replaced somehow as it is likely the lineID and stationID became invalid during the gap between the function being defined and being called.
Need to remove clearConstraintWindowLaterHACK.
Need to get elements to not destroy themselves while handling a click event, so this requires a refactor.
Error message: error: [string "D:/SteamLibrary/steamapps/workshop/content/1066780/2918585390/res/config/game_script/timetable_gui.lua"]:838: bad argument #1 to 'pairs' (table expected, got number) stack traceback: =C: ? =C: pairs D:/SteamLibrary/steamapps/workshop/content/1066780/2918585390/res/config/game_script/timetable_gui.lua(838): makeArrDepWindow D:/SteamLibrary/steamapps/workshop/content/1066780/2918585390/res/config/game_script/timetable_gui.lua(804): clearConstraintWindowLaterHACK D:/SteamLibrary/steamapps/workshop/content/1066780/2918585390/res/config/game_script/timetable_gui.lua(1170): ?
Caused by timetable.getCondition() returning a -1 error code instead of a table, and then timetable_gui attempts to unwrap using the lua pairs() function but fails as pairs requires table as a parameter, not a number
The cause us likely due to a line or station being deleted at the same time as the timetable window is opened, or another similarly rare event.
The fix for this issue is to ensure that errors are handled gracefully throughout timetable_gui. Also note that clearConstraintWindowLaterHACK was the calling function to this, and should probably be replaced somehow as it is likely the lineID and stationID became invalid during the gap between the function being defined and being called.
[Don't try to reproduce, you won't be able to]