(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 b1ef3b117e
commit 8992f9cb2b
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;