equal
deleted
inserted
replaced
82 // base tile cost depending on distance between edges |
82 // base tile cost depending on distance between edges |
83 segment_cost += Yapf().OneTileCost(tile, trackdir); |
83 segment_cost += Yapf().OneTileCost(tile, trackdir); |
84 |
84 |
85 const Vehicle* v = Yapf().GetVehicle(); |
85 const Vehicle* v = Yapf().GetVehicle(); |
86 // we have reached the vehicle's destination - segment should end here to avoid target skipping |
86 // we have reached the vehicle's destination - segment should end here to avoid target skipping |
87 if (v->current_order.type == OT_GOTO_STATION && tile == v->dest_tile) break; |
87 if (v->current_order.IsType(OT_GOTO_STATION) && tile == v->dest_tile) break; |
88 |
88 |
89 // stop if we have just entered the depot |
89 // stop if we have just entered the depot |
90 if (IsTileDepotType(tile, TRANSPORT_ROAD) && trackdir == DiagdirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) { |
90 if (IsTileDepotType(tile, TRANSPORT_ROAD) && trackdir == DiagdirToDiagTrackdir(ReverseDiagDir(GetRoadDepotDirection(tile)))) { |
91 // next time we will reverse and leave the depot |
91 // next time we will reverse and leave the depot |
92 break; |
92 break; |