Reverse behind signal pathfinding now takes into account train length

This is to avoid pathfinding into a reversing track section which
is too short
This commit is contained in:
Jonathan G Rennison
2021-09-11 14:53:08 +01:00
parent 29df09e917
commit 7018babeac
4 changed files with 48 additions and 6 deletions

View File

@@ -685,6 +685,7 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
if (!tf_local.Follow(cur.tile, cur.td)) {
assert(tf_local.m_err != TrackFollower::EC_NONE);
/* Can't move to the next tile (EOL?). */
if (!(end_segment_reason & (ESRB_RAIL_TYPE | ESRB_DEAD_END))) end_segment_reason |= ESRB_DEAD_END_EOL;
if (tf_local.m_err == TrackFollower::EC_RAIL_ROAD_TYPE) {
end_segment_reason |= ESRB_RAIL_TYPE;
} else {