equal
deleted
inserted
replaced
650 |
650 |
651 if (_patches.gotodepot && VehicleHasDepotOrders(v)) return; |
651 if (_patches.gotodepot && VehicleHasDepotOrders(v)) return; |
652 |
652 |
653 st = GetStation(v->current_order.station); |
653 st = GetStation(v->current_order.station); |
654 // only goto depot if the target airport has terminals (eg. it is airport) |
654 // only goto depot if the target airport has terminals (eg. it is airport) |
655 if (st->xy != 0 && st->airport_tile != 0 && GetAirport(st->airport_type)->terminals != NULL) { |
655 if (IsValidStation(st) && st->airport_tile != 0 && GetAirport(st->airport_type)->terminals != NULL) { |
656 // printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index); |
656 // printf("targetairport = %d, st->index = %d\n", v->u.air.targetairport, st->index); |
657 // v->u.air.targetairport = st->index; |
657 // v->u.air.targetairport = st->index; |
658 v->current_order.type = OT_GOTO_DEPOT; |
658 v->current_order.type = OT_GOTO_DEPOT; |
659 v->current_order.flags = OF_NON_STOP; |
659 v->current_order.flags = OF_NON_STOP; |
660 InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); |
660 InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR); |