1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

(svn r5153) - Fix: [YAPF] RVs can now plan path reversing in depot or end of road

This commit is contained in:
KUDr
2006-06-07 18:41:58 +00:00
parent f2f4ca1dc4
commit ace071529e
2 changed files with 35 additions and 8 deletions

View File

@@ -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;