Skip to content

Commit

Permalink
slighly more readable reflection
Browse files Browse the repository at this point in the history
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
  • Loading branch information
lamont-granquist committed Jul 10, 2023
1 parent 8e3791d commit fcb566a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions MechJeb2/MechJebLib/Simulations/SimVesselUpdater.cs
Expand Up @@ -223,11 +223,9 @@ private static void UpdateProceduralFairingDecoupler(SimProceduralFairingDecoupl
{
if (_pfDecoupled == null) return;

object obj;
if ((obj = _pfDecoupled.GetValue(kspPartModule)) == null)
decoupler.IsDecoupled = false;
else
decoupler.IsDecoupled = (bool)obj;
object fieldVal = _pfDecoupled.GetValue(kspPartModule);
if (fieldVal != null && fieldVal is bool)
decoupler.IsDecoupled = (bool)fieldVal;
}
}
}
Expand Down

0 comments on commit fcb566a

Please sign in to comment.