sswelm / KSPInterstellar

Obsolete
http://forum.kerbalspaceprogram.com/threads/111159-WIP-0-90-KSP-Interstellar-Extended-0-8-5-Improved-NTR-propelants
12 stars 10 forks source link

Reactor lifetime for molten salt reactor counts up from 0 rather than down #20

Open j-bos opened 8 years ago

j-bos commented 8 years ago

The displayed reactor lifetime counts up from zero as it accumulates Actinides. Should the "fuel_lifetime_d = Math.Min(fuel_lifetime_d, availability / fuel_use);" line be removed in the ReactorProducts loop?

            foreach (var product in current_fuel_mode.ReactorProducts)
            {
                double availability = getResourceAvailability(product.FuelName);
                GUILayout.BeginHorizontal();
                GUILayout.Label(product.FuelName, bold_label, GUILayout.Width(150));
                GUILayout.Label((availability * product.Density * 1000).ToString("0.000000") + " kg", GUILayout.Width(150));
                GUILayout.EndHorizontal();

                double fuel_use = total_power_per_frame * product.ProductUsePerMJ * fuelUsePerMJMult / TimeWarp.fixedDeltaTime / FuelEfficiency * current_fuel_mode.NormalisedReactionRate * GameConstants.EARH_DAY_SECONDS;
                fuel_lifetime_d = Math.Min(fuel_lifetime_d, availability / fuel_use);
                GUILayout.BeginHorizontal();
                GUILayout.Label(product.FuelName, bold_label, GUILayout.Width(150));
                GUILayout.Label(fuel_use.ToString("0.000000") + " " + product.Unit + "/day", GUILayout.Width(150));
                GUILayout.EndHorizontal();
            }

            PrintToGUILayout("Current Lifetime", (double.IsNaN(fuel_lifetime_d) ? "-" : (fuel_lifetime_d).ToString("0.00")) + " days", bold_label);
sswelm commented 8 years ago

Possibly, I need to investigate

quantum1423 commented 8 years ago

This is still an issue for me. All reactors have lifetimes that start at zero and count up, making the lifetime display rather useless.