Skip to content

Commit

Permalink
Fix Rendezvous Parameter check not honoring disableOnStateChange=false (
Browse files Browse the repository at this point in the history
  • Loading branch information
IO5 authored Jan 8, 2024
1 parent 39f2689 commit af495f9
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,14 @@ protected override void OnUpdate()
}

bool forceStateChange = false;
bool rendezvous = false;

// Distance to a specific craft
if (v2 != null)
{
float distance = Vector3.Distance(v1.transform.position, v2.transform.position);
if (distance < this.distance)
{
rendezvous = true;
forceStateChange |= SetState(v1, ParameterState.Complete);
forceStateChange |= SetState(v2, ParameterState.Complete);
}
bool rendezvous = distance < this.distance;
forceStateChange |= SetState(v1, rendezvous ? ParameterState.Complete : ParameterState.Incomplete);
forceStateChange |= SetState(v2, rendezvous ? ParameterState.Complete : ParameterState.Incomplete);
}
else
{
Expand All @@ -164,20 +160,14 @@ protected override void OnUpdate()
if (v != v1 && v.vesselType != VesselType.EVA && v.vesselType != VesselType.Debris && v.vesselType != VesselType.Flag)
{
float distance = Vector3.Distance(v1.transform.position, v.transform.position);
if (distance < this.distance)
{
rendezvous = true;
forceStateChange |= SetState(v1, ParameterState.Complete);
forceStateChange |= SetState(v, ParameterState.Complete);
}
bool rendezvous = distance < this.distance;
forceStateChange |= SetState(v1, rendezvous ? ParameterState.Complete : ParameterState.Incomplete);
forceStateChange |= SetState(v, rendezvous ? ParameterState.Complete : ParameterState.Incomplete);
}
}
}

if (rendezvous)
{
CheckVessel(FlightGlobals.ActiveVessel, forceStateChange);
}
CheckVessel(FlightGlobals.ActiveVessel, forceStateChange);
}
}

Expand Down

0 comments on commit af495f9

Please sign in to comment.