From 9326e9e687be5f3f8d854be20dcbe7c263c12717 Mon Sep 17 00:00:00 2001 From: NathanKell Date: Thu, 27 Jun 2024 14:56:01 -0700 Subject: [PATCH] Rewrite Ops time/efficiency prediction to match VBP version --- Source/RP0/SpaceCenter/Projects/LCOpsProject.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/RP0/SpaceCenter/Projects/LCOpsProject.cs b/Source/RP0/SpaceCenter/Projects/LCOpsProject.cs index 02fb9164d35..c3203c37341 100644 --- a/Source/RP0/SpaceCenter/Projects/LCOpsProject.cs +++ b/Source/RP0/SpaceCenter/Projects/LCOpsProject.cs @@ -150,17 +150,15 @@ public double GetTimeLeft() private double TimeLeftWithEfficiencyIncrease(double timeLeft) { - if (LC.Efficiency == LCEfficiency.MaxEfficiency) + if (LC.Efficiency == LCEfficiency.MaxEfficiency || timeLeft < 86400d) return timeLeft; - if (timeLeft > 86400d) + double bpDivRate = timeLeft * LC.Efficiency; + double newEff = LC.Efficiency; + double portion = LC.Engineers / (double)LC.MaxEngineers; + for (int i = 0; i < 4; ++i) { - double newEff = LC.Efficiency; - double portion = LC.Engineers / (double)LC.MaxEngineers; - for (int i = 0; i < 4; ++i) - { - timeLeft = (timeLeft * newEff) / LC.EfficiencySource.PredictWeightedEfficiency(timeLeft, portion, out newEff, LC.Efficiency); - } + timeLeft = bpDivRate / LC.EfficiencySource.PredictWeightedEfficiency(timeLeft, portion, out newEff, LC.Efficiency); } return timeLeft; }