src/aircraft_cmd.cpp
changeset 9921 4dfac3c48507
parent 9688 c3e4766447ed
child 9923 3056bf623139
--- a/src/aircraft_cmd.cpp	Fri Aug 15 12:47:20 2008 +0000
+++ b/src/aircraft_cmd.cpp	Fri Aug 15 13:57:43 2008 +0000
@@ -496,48 +496,6 @@
 	return ret;
 }
 
-/** Start/Stop an aircraft.
- * @param tile unused
- * @param flags for command type
- * @param p1 aircraft ID to start/stop
- * @param p2 unused
- * @return result of operation.  Nothing if everything went well
- */
-CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
-{
-	if (!IsValidVehicleID(p1)) return CMD_ERROR;
-
-	Vehicle *v = GetVehicle(p1);
-
-	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
-
-	/* cannot stop airplane when in flight, or when taking off / landing */
-	if (v->u.air.state >= STARTTAKEOFF && v->u.air.state < TERM7)
-		return_cmd_error(STR_A017_AIRCRAFT_IS_IN_FLIGHT);
-
-	/* Check if this aircraft can be started/stopped. The callback will fail or
-	 * return 0xFF if it can. */
-	uint16 callback = GetVehicleCallback(CBID_VEHICLE_START_STOP_CHECK, 0, 0, v->engine_type, v);
-	if (callback != CALLBACK_FAILED && GB(callback, 0, 8) != 0xFF) {
-		StringID error = GetGRFStringID(GetEngineGRFID(v->engine_type), 0xD000 + callback);
-		return_cmd_error(error);
-	}
-
-	if (flags & DC_EXEC) {
-		if (v->IsStoppedInDepot()) {
-			DeleteVehicleNews(p1, STR_A014_AIRCRAFT_IS_WAITING_IN);
-		}
-
-		v->vehstatus ^= VS_STOPPED;
-		v->cur_speed = 0;
-		InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
-		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
-		InvalidateWindowClasses(WC_AIRCRAFT_LIST);
-	}
-
-	return CommandCost();
-}
-
 bool Aircraft::FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse)
 {
 	const Station *st = GetStation(this->u.air.targetairport);