summaryrefslogtreecommitdiff
path: root/pathfind.c
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2005-07-03 13:02:54 +0000
committermatthijs <matthijs@openttd.org>2005-07-03 13:02:54 +0000
commitfb8e5f61b181ca34c43d0a0e8d39ee95af2eb60a (patch)
tree6d371024326a8ed726a5b94394047c888bd1a2c8 /pathfind.c
parent6df35235d5b610262af8777cf2047245d271e5c9 (diff)
downloadopenttd-fb8e5f61b181ca34c43d0a0e8d39ee95af2eb60a.tar.xz
(svn r2514) - Codechange: [NPF] Move the checking of railtype into a funciton IsCompatibleRail().
- Codechange: [NPF] Check the railtype along a route against the engine type instead of against the previouse tile. This clears the way for electriefied rails. - Add: [NPF] [ 1209644 ] A penalty for crossings (peter1138)
Diffstat (limited to 'pathfind.c')
-rw-r--r--pathfind.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pathfind.c b/pathfind.c
index 376c584fd..fc8b543db 100644
--- a/pathfind.c
+++ b/pathfind.c
@@ -131,6 +131,7 @@ static void TPFMode2(TrackPathFinder *tpf, TileIndex tile, int direction)
RememberData rd;
int owner = -1;
+ /* XXX: Mode 2 is currently only used for ships, why is this code here? */
if (tpf->tracktype == TRANSPORT_RAIL) {
if (IsTileType(tile, MP_RAILWAY) || IsTileType(tile, MP_STATION) || IsTileType(tile, MP_TUNNELBRIDGE)) {
owner = GetTileOwner(tile);
@@ -340,6 +341,10 @@ static void TPFMode1(TrackPathFinder *tpf, TileIndex tile, int direction)
/* if i can get rid of this, tail end recursion can be used to minimize
* stack space dramatically. */
+
+ /* If we are doing signal setting, we must reverse at evere tile, so we
+ * iterate all the tracks in a signal block, even when a normal train would
+ * not reach it (for example, when two lines merge */
if (tpf->hasbit_13)
return;