Skip to content

Commit

Permalink
Showing 4 changed files with 44 additions and 3 deletions.
Binary file modified GameData/RP-0/Plugins/RP0.dll
Binary file not shown.
Binary file modified GameData/RP-0/Plugins/RP0KCTBinder.dll
Binary file not shown.
18 changes: 17 additions & 1 deletion Source/KCTBinderModule.cs
Original file line number Diff line number Diff line change
@@ -16,10 +16,26 @@ public class KCTBinderModule : ScenarioModule
protected double nextTime = -1d;
protected double checkInterval = 0.5d;
protected int[] padCounts = new int[10];

protected bool skipOne = true;
protected bool skipTwo = true;

protected void Update()
{
if (HighLogic.CurrentGame == null)
if (HighLogic.CurrentGame == null || !FlightGlobals.ready)
return;

if (skipOne)
{
skipOne = false;
return;
}

if (skipTwo)
{
skipTwo = false;
return;
}

if (KerbalConstructionTime.KerbalConstructionTime.instance == null)
return;
29 changes: 27 additions & 2 deletions Source/Maintenance/MaintenanceHandler.cs
Original file line number Diff line number Diff line change
@@ -20,7 +20,13 @@ public class MaintenanceHandler : ScenarioModule

protected double updateInterval = 3600d;

protected bool wasWarpingHigh = true;
protected bool wasWarpingHigh = false;

protected static bool firstLoad = true;

protected bool skipOne = true;
protected bool skipTwo = true;
protected bool skipThree = true;

public double kctBuildRate = 0;
public double kctResearcRate = 0;
@@ -63,9 +69,26 @@ public override void OnAwake()

public void Update()
{
if (HighLogic.CurrentGame == null)
if (HighLogic.CurrentGame == null || !FlightGlobals.ready)
return;

if (skipOne)
{
skipOne = false;
return;
}

if (skipTwo)
{
skipTwo = false;
return;
}
if (skipThree)
{
skipThree = false;
return;
}

if (facilityLevels.Count == 0)
{
foreach (Upgradeables.UpgradeableFacility facility in GameObject.FindObjectsOfType<Upgradeables.UpgradeableFacility>())
@@ -79,6 +102,8 @@ public void Update()
{
if (wasWarpingHigh && TimeWarp.CurrentRate <= 100f)
wasWarpingHigh = false;
else if (firstLoad)
firstLoad = false;
else
return;
}

0 comments on commit c5415cb

Please sign in to comment.