summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2007-07-09 18:57:12 +0000
committerKUDr <kudr@openttd.org>2007-07-09 18:57:12 +0000
commit3efc078e2fde3966b01818b794a661c9cc4e9e8c (patch)
treee2f206dcbad5e559b0490e5fde1782f029bab0dc /src/yapf
parent25511e0e26f37f3dfe03bd5c724bd4b264a4efd3 (diff)
downloadopenttd-3efc078e2fde3966b01818b794a661c9cc4e9e8c.tar.xz
(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.
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/yapf_costrail.hpp6
1 files changed, 5 insertions, 1 deletions
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;
}