(svn r7657) -Fix (r6291): 'Goto Depot' did not work for helicopters going to an airport without depot (mart3p).
authorrubidium
Sat, 30 Dec 2006 21:41:15 +0000
changeset 5689 430135ca34f3
parent 5688 81618596a51b
child 5690 749dd7784706
(svn r7657) -Fix (r6291): 'Goto Depot' did not work for helicopters going to an airport without depot (mart3p).
aircraft_cmd.c
--- a/aircraft_cmd.c	Sat Dec 30 18:21:33 2006 +0000
+++ b/aircraft_cmd.c	Sat Dec 30 21:41:15 2006 +0000
@@ -543,7 +543,6 @@
 		if (!IsValidStation(st) || st->airport_tile == 0 || GetAirport(st->airport_type)->nof_depots == 0) {
 			StationID station;
 
-			if (!(p2 & DEPOT_LOCATE_HANGAR)) return CMD_ERROR;
 			// the aircraft has to search for a hangar on its own
 			station = FindNearestHangar(v);
 
@@ -561,7 +560,7 @@
 			v->current_order.refit_cargo = CT_INVALID;
 			v->current_order.dest = next_airport_index;
 			InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
-			if (p2 & DEPOT_LOCATE_HANGAR || (p2 & DEPOT_SERVICE && v->u.air.state == FLYING && !next_airport_has_hangar)) {
+			if (v->u.air.state == FLYING && !next_airport_has_hangar) {
 				/* The aircraft is now heading for a different hangar than the next in the orders */
 				AircraftNextAirportPos_and_Order(v);
 				v->u.air.targetairport = next_airport_index;