summaryrefslogtreecommitdiff
path: root/yapf/yapf_road.cpp
diff options
context:
space:
mode:
authorKUDr <kudr@openttd.org>2006-06-07 18:41:58 +0000
committerKUDr <kudr@openttd.org>2006-06-07 18:41:58 +0000
commitace071529e2116f92aeec50d3bac0f95953b129b (patch)
tree886f4442bbecca8e23f40e5353b6ac5f72de7778 /yapf/yapf_road.cpp
parentf2f4ca1dc4ac8b7713739eb35d73d6e6b016fa41 (diff)
downloadopenttd-ace071529e2116f92aeec50d3bac0f95953b129b.tar.xz
(svn r5153) - Fix: [YAPF] RVs can now plan path reversing in depot or end of road
Diffstat (limited to 'yapf/yapf_road.cpp')
-rw-r--r--yapf/yapf_road.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/yapf/yapf_road.cpp b/yapf/yapf_road.cpp
index 6fbff3ecb..d0a06c0f4 100644
--- a/yapf/yapf_road.cpp
+++ b/yapf/yapf_road.cpp
@@ -76,7 +76,13 @@ public:
// base tile cost depending on distance between edges
segment_cost += Yapf().OneTileCost(tile, trackdir);
- // if there are no reachable trackdirs n new tile, we have end of road
+ // stop if we have just entered the depot
+ if (IsTileDepotType(tile, TRANSPORT_ROAD) && trackdir == DiagdirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) {
+ // next time we will reverse and leave the depot
+ break;
+ }
+
+ // if there are no reachable trackdirs on new tile, we have end of road
TrackFollower F;
if (!F.Follow(tile, trackdir)) break;