File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -256,9 +256,16 @@ void IParserEventSubscriber.PostApply(ConfigNode node)
256
256
body . Value . generatedBody . transform . parent = systemPrefab . transform ;
257
257
258
258
// Delete ghost space centers
259
- if ( ! body . Value . generatedBody . celestialBody . isHomeWorld )
259
+ if ( ! body . Value . generatedBody . celestialBody . isHomeWorld && body . Value . generatedBody . pqsVersion != null )
260
260
{
261
- UnityEngine . Object . Destroy ( body . Value . generatedBody . pqsVersion . GetComponentInChildren < SpaceCenter > ( ) ) ;
261
+ SpaceCenter [ ] centers = body . Value . generatedBody . pqsVersion . GetComponentsInChildren < SpaceCenter > ( true ) ;
262
+ if ( centers != null )
263
+ {
264
+ foreach ( SpaceCenter c in centers )
265
+ {
266
+ UnityEngine . Object . Destroy ( c ) ;
267
+ }
268
+ }
262
269
}
263
270
}
264
271
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ public void PostSpawnFixups()
118
118
Debug . Log ( "[Kopernicus]: Post-Spawn" ) ;
119
119
120
120
// Fix the SpaceCenter
121
- SpaceCenter . Instance = PSystemManager . Instance . localBodies . First ( cb => cb . isHomeWorld ) . GetComponentInChildren < SpaceCenter > ( ) ;
121
+ SpaceCenter . Instance = PSystemManager . Instance . localBodies . First ( cb => cb . isHomeWorld ) . GetComponentsInChildren < SpaceCenter > ( true ) . FirstOrDefault ( ) ;
122
122
SpaceCenter . Instance . Start ( ) ;
123
123
124
124
// Fix the flight globals index of each body and patch it's SOI
You can’t perform that action at this time.
0 commit comments