src/yapf/yapf_road.cpp
branchnoai
changeset 9869 6404afe43575
parent 9732 f8eb3e208514
child 10213 23cfd330ccac
child 10249 58810805030e
equal deleted inserted replaced
9868:3998f2e73dda 9869:6404afe43575
    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;