Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 207ddac223ae
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 15a28834e3b7
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Mar 17, 2017

  1. Copy the full SHA
    dab6775 View commit details
  2. Merge pull request #1271 from eggrobin/nullrefs-with-precalc

    Deal with null reference exceptions on vessel destruction
    eggrobin authored Mar 17, 2017
    Copy the full SHA
    15a2883 View commit details
Showing with 5 additions and 1 deletion.
  1. +5 −1 ksp_plugin_adapter/ksp_plugin_adapter.cs
6 changes: 5 additions & 1 deletion ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
@@ -877,7 +877,8 @@ Vessel vessel in FlightGlobals.Vessels.Where(is_on_rails_in_space)) {
}

private void DisableVesselPrecalculate() {
foreach (var vessel in FlightGlobals.Vessels) {
foreach (var vessel in
FlightGlobals.Vessels.Where(vessel => vessel.precalc != null)) {
vessel.precalc.enabled = false;
}
}
@@ -902,6 +903,9 @@ private void SetBodyFramesAndPrecalculateVessels() {
// since vessel.precalc.FixedUpdate may remove its vessel.
for (int i = FlightGlobals.Vessels.Count - 1; i >= 0; --i) {
var vessel = FlightGlobals.Vessels[i];
if (vessel.precalc == null) {
continue;
}
vessel.precalc.enabled = true;
vessel.precalc.FixedUpdate();
}