Skip to content

Commit

Permalink
Fix issue of vessels connecting to ground stations not built yet
Browse files Browse the repository at this point in the history
  • Loading branch information
KSP-TaxiService committed Jan 19, 2021
1 parent 0577738 commit e6b5d77
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/CommNetConstellation/CommNetLayer/CNCCommNetHome.cs
Expand Up @@ -446,7 +446,7 @@ public static Texture2D getGroundStationTexture(int techLevel)
/// Comment: Subclassing GameVariables.Instance.GetDSNRange to just change the ranges is too excessive at this point.
public double GetDSNRange(short level)
{
double power;
double power = 0.0;
if (this.CommNetHome.isKSC)
{
power = CNCSettings.Instance.KSCStationPowers[level - 1];
Expand All @@ -455,7 +455,7 @@ public double GetDSNRange(short level)
{
if (level == 0)
{
power = 0;
power = 0.0;
}
else
{
Expand All @@ -471,6 +471,12 @@ public double GetDSNRange(short level)
/// </summary>
protected override void Update()
{
if (HighLogic.CurrentGame == null)
return;

if (!(HighLogic.LoadedScene == GameScenes.FLIGHT || HighLogic.LoadedScene == GameScenes.TRACKSTATION))
return;

if (this.comm != null && this.body != null)
{
this.comm.precisePosition = this.body.GetWorldSurfacePosition(this.latitude, this.longitude, this.altitude);
Expand All @@ -481,6 +487,8 @@ protected override void Update()
{
this.CommNetHome.nodeTransform.position = this.comm.precisePosition;
}

this.refresh();
}
}

Expand Down

0 comments on commit e6b5d77

Please sign in to comment.