Closed armyf35 closed 7 months ago
Added another bugfix for the distance checking. Changed it to use track distance between the front/rear of the center car to the edge of all track spans associated with a station.
Vector3.Distance
once close enough so the train stops in the middle of the span rather than once the car is close enough to the edge of the span. This does cause the distance to drop a bit when approaching the station in an abrupt manner when it swaps over (Check logs below for an example)
[04:46:32.07 INF RouteManager] 2024-01-10 04:46:32Z - Dispatcher_V2.0.0.3 - VER: Locomotive: TEST 9754 Distance to Station: 99.41132 Prev Distance: 105.2356
[04:46:32.07 INF RouteManager] 2024-01-10 04:46:32Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: onApproachShortDist
[04:46:32.07 INF RouteManager] 2024-01-10 04:46:32Z - Dispatcher_V2.0.0.3 - VER: Locomotive TEST 9754 triggered Short Approach.
[04:46:32.08 INF RouteManager] 2024-01-10 04:46:32Z - Dispatcher_V2.0.0.3 - DEB: Locomotive TEST 9754 on Short Approach! Speed limited to 16
[04:46:32.08 INF RouteManager] 2024-01-10 04:46:32Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: onApproachShortDist
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: needToExitCoroutine
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: IsAnyStationSelectedForLocomotive
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: needToExitCoroutine
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - INF: Loco: TEST 9754 getting distance to destination
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - VER: Locomotive: TEST 9754 Distance to Station: 93.73178 Prev Distance: 99.41132
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: onApproachShortDist
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - VER: Locomotive TEST 9754 triggered Short Approach.
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - DEB: Locomotive TEST 9754 on Short Approach! Speed limited to 15
[04:46:33.09 INF RouteManager] 2024-01-10 04:46:33Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: onApproachShortDist
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: needToExitCoroutine
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: IsAnyStationSelectedForLocomotive
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: needToExitCoroutine
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - INF: Loco: TEST 9754 getting distance to destination
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - VER: Locomotive: TEST 9754 Distance to Station: 55.24473 Prev Distance: 93.73178
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: onApproachShortDist
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - VER: Locomotive TEST 9754 triggered Short Approach.
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - DEB: Locomotive TEST 9754 on Short Approach! Speed limited to 9
[04:46:34.13 INF RouteManager] 2024-01-10 04:46:34Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: onApproachShortDist
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: needToExitCoroutine
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: IsAnyStationSelectedForLocomotive
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: needToExitCoroutine
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - INF: Loco: TEST 9754 getting distance to destination
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - VER: Locomotive: TEST 9754 Distance to Station: 49.18457 Prev Distance: 55.24473
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: onApproachShortDist
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - VER: Locomotive TEST 9754 triggered Short Approach.
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - VER: Locomotive TEST 9754 activating Approach Bell at distance 50
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - DEB: Locomotive TEST 9754 on Short Approach! Speed limited to 8
[04:46:35.15 INF RouteManager] 2024-01-10 04:46:35Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: onApproachShortDist
[04:46:36.17 INF RouteManager] 2024-01-10 04:46:36Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: needToExitCoroutine
[04:46:36.17 INF RouteManager] 2024-01-10 04:46:36Z - Dispatcher_V2.0.0.3 - TRA: ENTERED FUNCTION: IsAnyStationSelectedForLocomotive
[04:46:36.17 INF RouteManager] 2024-01-10 04:46:36Z - Dispatcher_V2.0.0.3 - TRA: EXITING FUNCTION: needToExitCoroutine
I merged everything on my fork, if you want me to separate things out into bugfixes vs features or even just individual things let me know.
Below is a overview of the changes:
CopyStationsFromLocoToCoaches
to fix #77 (604b8df8d5173ce7791326d22c6cdb091002ca29)