summaryrefslogtreecommitdiff
path: root/src
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
commit746a33747bba9b28a116446e3a9bf4324e7569b4 (patch)
treee2f206dcbad5e559b0490e5fde1782f029bab0dc /src
parentf183f465612b10ba67ca7a896a40a991749b81b5 (diff)
downloadopenttd-746a33747bba9b28a116446e3a9bf4324e7569b4.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')
-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;
}