From 3efc078e2fde3966b01818b794a661c9cc4e9e8c Mon Sep 17 00:00:00 2001 From: KUDr Date: Mon, 9 Jul 2007 18:57:12 +0000 Subject: (svn r10491) -Fix [FS#988, YAPF]: When rail segment was cached using electric engine and it ended with non-electric rail it was incorrectly cached with the end reason ESRB_DEAD_END instead of ESRB_RAIL_TYPE. (Eddi) - It caused YAPF to end prematurely there when it was searching for another path (for non-electric engine). - It can lead to sub-optimal path taken or 'train is lost' message. - In MP game it can also cause desync. - Uses changes made in r10489. --- src/yapf/yapf_costrail.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/yapf/yapf_costrail.hpp b/src/yapf/yapf_costrail.hpp index a95b3c9a6..8ecd4e94a 100644 --- a/src/yapf/yapf_costrail.hpp +++ b/src/yapf/yapf_costrail.hpp @@ -378,7 +378,11 @@ 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?). */ - end_segment_reason |= ESRB_DEAD_END; + if (tf_local.m_err == TrackFollower::EC_RAIL_TYPE) { + end_segment_reason |= ESRB_RAIL_TYPE; + } else { + end_segment_reason |= ESRB_DEAD_END; + } break; } -- cgit v1.2.3-54-g00ecf