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
commit8992f9cb2bf20a1615f99735d13ade6b2535cbcf (patch)
tree886f4442bbecca8e23f40e5353b6ac5f72de7778 /yapf/yapf_road.cpp
parentb1ef3b117eb04f1dd7675f4a796f390aedfadba9 (diff)
downloadopenttd-8992f9cb2bf20a1615f99735d13ade6b2535cbcf.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;