File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,16 +16,6 @@ internal void Start()
1616 Log ( "Setting modded tech tree as the active one" ) ;
1717 HighLogic . CurrentGame . Parameters . Career . TechTreeUrl = techTreeFile ;
1818 }
19-
20- if ( PhysicsGlobals . PhysicsDatabaseFilename != physicsFile && File . Exists ( physicsPath ) )
21- {
22- Log ( "Setting modded physics as the active one" ) ;
23-
24- PhysicsGlobals . PhysicsDatabaseFilename = physicsFile ;
25-
26- if ( ! PhysicsGlobals . Instance . LoadDatabase ( ) )
27- Log ( "Something went wrong while setting the active physics config." ) ;
28- }
2919 }
3020
3121 public static void Log ( String s )
Original file line number Diff line number Diff line change @@ -130,6 +130,8 @@ private IEnumerator Run()
130130 logger . Info ( "Reloading Part Upgrades" ) ;
131131 PartUpgradeManager . Handler . FillUpgrades ( ) ;
132132
133+ LoadModdedPhysics ( ) ;
134+
133135 yield return null ;
134136
135137 progressTitle = "ModuleManager: Running post patch callbacks" ;
@@ -209,5 +211,23 @@ private IEnumerator Run()
209211
210212 ready = true ;
211213 }
214+
215+ private void LoadModdedPhysics ( )
216+ {
217+ if ( PhysicsGlobals . PhysicsDatabaseFilename == physicsFile ) return ;
218+
219+ if ( ! File . Exists ( physicsPath ) )
220+ {
221+ logger . Error ( "Physics file not found" ) ;
222+ return ;
223+ }
224+
225+ logger . Info ( "Setting modded physics as the active one" ) ;
226+
227+ PhysicsGlobals . PhysicsDatabaseFilename = physicsFile ;
228+
229+ if ( ! PhysicsGlobals . Instance . LoadDatabase ( ) )
230+ logger . Error ( "Something went wrong while setting the active physics config." ) ;
231+ }
212232 }
213233}
You can’t perform that action at this time.
0 commit comments