aircraft_cmd.c
changeset 4346 66105d4f6e83
parent 4344 7e123fec5b0b
child 4351 c9799dd53eec
equal deleted inserted replaced
4345:1da147230c79 4346:66105d4f6e83
   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);