Skip to content

Commit cb43e9c

Browse files
Removed the excessive match check on maneuver node ('No maneuver node found' error msg)
1 parent 562887f commit cb43e9c

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/RemoteTech/FlightComputer/Commands/ManeuverCommand.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,8 @@ public override bool Pop(FlightComputer f)
5252
f.Vessel.patchedConicSolver.Update();
5353
}
5454

55-
// check if the stored node is still valid
56-
if (f.Vessel.patchedConicSolver.maneuverNodes.FindIndex(x => x.UT == this.Node.UT && x.DeltaV == this.Node.DeltaV) < 0)//IndexOf() is bad comparer
57-
{
58-
RTUtil.ScreenMessage("[Flight Computer]: No maneuver node found.");
59-
return false;
60-
}
61-
6255
if (this.Node.solver == null) // need to repair (due to the scenario of 2 vessels within phyical range)
63-
this.Node = f.Vessel.patchedConicSolver.maneuverNodes.Find(x => x.UT == this.Node.UT && x.DeltaV == this.Node.DeltaV);
56+
this.Node = f.Vessel.patchedConicSolver.maneuverNodes.Find(x => x.UT == this.Node.UT);
6457

6558
var burn = f.ActiveCommands.FirstOrDefault(c => c is BurnCommand);
6659
if (burn != null) {
@@ -296,7 +289,7 @@ public override void Save(ConfigNode n, FlightComputer fc)
296289
}
297290

298291
// search the node on the List
299-
this.NodeIndex = fc.Vessel.patchedConicSolver.maneuverNodes.FindIndex(x => x.UT == this.Node.UT && x.DeltaV == this.Node.DeltaV);
292+
this.NodeIndex = fc.Vessel.patchedConicSolver.maneuverNodes.FindIndex(x => x.UT == this.Node.UT);
300293

301294
// only save this command if we are on the maneuverNode list
302295
if (this.NodeIndex >= 0)

0 commit comments

Comments
 (0)