bool transferFuel(Part source, Part dest, float amount, int FuelType)
    {
        bool wasDeactive = false;

        if (dest.State == PartStates.DEACTIVATED)
        {
            dest.force_activate();
            wasDeactive = true;
        }
        float fuelBefore = getFuelForPartAndFueltype(source, FuelType);

        bool deactivated = false;

        if (source is IFuelSource)
        {
            IFuelSource ifs = (IFuelSource)source;
            if (ifs.FuelType.Equals(fts.ElementAt(FuelType)) && ifs.RequestFuel(amount, fts.ElementAt(FuelType)))
            {
                addFuel(dest, amount, FuelType);

                /*
                 * if (fuelBefore - amount != getFuelForPartAndFueltype(source, FuelType)) {
                 *  addFuel(source, fuelBefore - amount, FuelType);
                 * }
                 */
            }
            if (ifs.Fuel <= 0.0)
            {
                source.deactivate();
                deactivated = true;
            }
        }
        else
        {
            if (FuelType == RegularFuel && source is FuelTank)
            {
                FuelTank ft = (FuelTank)source;
                ft.fuel -= amount;
                addFuel(dest, amount, FuelType);
                if (ft.fuel <= 0.0)
                {
                    ft.deactivate();
                    deactivated = true;
                }
            }
            else if (FuelType == RCSFuel && source is RCSFuelTank)
            {
                RCSFuelTank ft = (RCSFuelTank)source;
                ft.fuel -= amount;
                addFuel(dest, amount, FuelType);

                /*
                 * if (fuelBefore - amount != getFuelForPartAndFueltype(source, FuelType)) {
                 *  addFuel(source, fuelBefore - amount, FuelType);
                 * }
                 */
                if (ft.fuel <= 0.0)
                {
                    ft.deactivate();
                    deactivated = true;
                }
            }
        }

        if (wasDeactive)
        {
            source.deactivate();
        }
        return(deactivated);
    }