virtual public void FitEngineIfNecessary()
        {
            bool doFit = false;

            foreach (EngineParameterInfo entry in engineFitParameters)
            {
                if (ShouldFitParameter(entry))
                {
                    doFit = true;
                    break;
                }
            }

            // No parameters can be fit
            if (!doFit)
            {
                return;
            }

            doFit = false;

            ConfigNode node = EngineDatabase.GetNodeForEngine(this);

            if (node != null)
            {
                doFit |= EngineDatabase.PluginUpdateCheck(this, node);

                // Check for changes
                foreach (EngineParameterInfo entry in engineFitParameters)
                {
                    // Don't check things we're going to fit
                    if (ShouldFitParameter(entry))
                    {
                        continue;
                    }

                    if (!entry.EqualsValueInNode(node))
                    {
                        doFit = true;
                        break;
                    }
                }
                if (!doFit && node != null)
                {
                    Debug.Log("[" + this.GetType().Name + "] Reading engine params from cache for engine " + part.name);

                    CreateEngineIfNecessary();

                    foreach (EngineParameterInfo entry in engineFitParameters)
                    {
                        // Only copy things that would be fitted
                        if (ShouldFitParameter(entry))
                        {
                            entry.SetValueFromNode(node);
                        }
                    }
                    PushFitParamsToSolver();
                }
            }
            else
            {
                doFit = true;
            }

            if (doFit)
            {
                Debug.Log("[" + this.GetType().Name + "] Fitting params for engine " + part.name);

                CreateEngineIfNecessary();

                // Copy valid fit results from database - they might still be correct
                if (node != null)
                {
                    foreach (EngineParameterInfo entry in engineFitParameters)
                    {
                        // Only copy things that would be fitted
                        if (ShouldFitParameter(entry))
                        {
                            entry.SetValueFromNode(node);
                        }
                    }
                }

                // Make sure everything has the correct value
                PushFitParamsToSolver();
                DoEngineFit();

                ConfigNode newNode = new ConfigNode();

                foreach (EngineParameterInfo entry in engineFitParameters)
                {
                    newNode.SetValue(entry.Name, entry.GetValueStr(), true);
                }

                EngineDatabase.SetNodeForEngine(this, newNode);
            }
        }