Skip to content

Commit 7c88603

Browse files
committed
Fix #83: suppress all variable updates until time has actually passed
1 parent 21e2cd1 commit 7c88603

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

RasterPropMonitor/Core/RPMVCPerModule.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public partial class RPMVesselComputer : VesselModule
4040

4141
private bool listsInvalid = true;
4242
private readonly static List<string> emptyIgnoreList = new List<string>();
43-
private double lastUTC;
4443

4544
//--- Docking Nodes
4645
internal List<ModuleDockingNode> availableDockingNodes = new List<ModuleDockingNode>();
@@ -894,12 +893,6 @@ internal void FetchPerModuleData()
894893
return;
895894
}
896895

897-
double currentUTC = Planetarium.fetch.time;
898-
if (currentUTC == lastUTC)
899-
{
900-
return;
901-
}
902-
903896
UpdateModuleLists();
904897

905898
bool requestReset = false;
@@ -920,8 +913,6 @@ internal void FetchPerModuleData()
920913
{
921914
InvalidateModuleLists();
922915
}
923-
924-
lastUTC = currentUTC;
925916
}
926917
#endregion
927918

RasterPropMonitor/Core/RPMVesselComputer.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public partial class RPMVesselComputer : VesselModule
107107
private int dataUpdateCountdown;
108108
private int refreshDataRate = 60;
109109
private bool timeToUpdate = false;
110+
private double lastUTC;
110111

111112
// Craft-relative basis vectors
112113
internal Vector3 forward;
@@ -765,6 +766,12 @@ public void Update()
765766

766767
public void UpdateVariables()
767768
{
769+
double currentUTC = Planetarium.fetch.time;
770+
if (currentUTC == lastUTC)
771+
{
772+
return;
773+
}
774+
768775
// Update values related to the vessel (position, CoM, etc)
769776
if (timeToUpdate)
770777
{
@@ -786,6 +793,8 @@ public void UpdateVariables()
786793
FetchVesselData();
787794
FetchTargetData();
788795
}
796+
797+
lastUTC = currentUTC;
789798
}
790799

791800
//private void DebugFunction()

0 commit comments

Comments
 (0)