src/aircraft_cmd.cpp
changeset 8191 3ffc17ef4ff5
parent 8179 1fa8cc3fbeb8
child 8196 ce66e31a152c
equal deleted inserted replaced
8190:efd1f3b110a2 8191:3ffc17ef4ff5
   485 	Vehicle *v = GetVehicle(p1);
   485 	Vehicle *v = GetVehicle(p1);
   486 
   486 
   487 	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
   487 	if (v->type != VEH_AIRCRAFT || !CheckOwnership(v->owner)) return CMD_ERROR;
   488 	if (!v->IsStoppedInDepot()) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
   488 	if (!v->IsStoppedInDepot()) return_cmd_error(STR_A01B_AIRCRAFT_MUST_BE_STOPPED);
   489 
   489 
       
   490 	if (HASBITS(v->vehstatus, VS_CRASHED)) return_cmd_error(STR_CAN_T_SELL_DESTROYED_VEHICLE);
       
   491 
   490 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
   492 	SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES);
   491 
   493 
   492 	if (flags & DC_EXEC) {
   494 	if (flags & DC_EXEC) {
   493 		// Invalidate depot
   495 		// Invalidate depot
   494 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
   496 		InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);