Skip to content

Commit 7f2e856

Browse files
committed
Reapplying "Some weird situation preventing KSP to "upload" to the GameDatabase the new TechTree we detected and, hopefully, workarounded."
1 parent 7559131 commit 7f2e856

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

Source/ModuleManager/CustomConfigsManager.cs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,37 @@ namespace ModuleManager
99
[KSPAddon(KSPAddon.Startup.SpaceCentre, false)]
1010
public class CustomConfigsManager : MonoBehaviour
1111
{
12+
internal static bool start_techtree_loaded = false;
13+
internal static bool start_physics_loaded = false;
1214
internal void Start()
1315
{
14-
if (HighLogic.CurrentGame.Parameters.Career.TechTreeUrl != TECHTREE_CONFIG.Path && TECHTREE_CONFIG.IsLoadable)
16+
#if false
17+
Log("Blah");
18+
Log(HighLogic.CurrentGame.Parameters.Career.TechTreeUrl);
19+
Log(TECHTREE_CONFIG.Path);
20+
Log(TECHTREE_CONFIG.IsLoadable.ToString());
21+
#endif
22+
if (!start_techtree_loaded && TECHTREE_CONFIG.IsLoadable)
1523
{
1624
Log("Setting modded tech tree as the active one");
17-
HighLogic.CurrentGame.Parameters.Career.TechTreeUrl = TECHTREE_CONFIG.Path;
25+
HighLogic.CurrentGame.Parameters.Career.TechTreeUrl = TECHTREE_CONFIG.KspPath;
26+
start_techtree_loaded = true;
1827
}
1928

20-
if (PhysicsGlobals.PhysicsDatabaseFilename != PHYSICS_CONFIG.Path && PHYSICS_CONFIG.IsLoadable)
29+
if (!start_physics_loaded && PHYSICS_CONFIG.IsLoadable)
2130
{
2231
Log("Setting modded physics as the active one");
23-
2432
PhysicsGlobals.PhysicsDatabaseFilename = PHYSICS_CONFIG.Path;
25-
2633
if (!PhysicsGlobals.Instance.LoadDatabase())
2734
Log("Something went wrong while setting the active physics config.");
35+
start_physics_loaded = true;
2836
}
2937
}
3038

31-
public static void Log(String s)
39+
private static readonly KSPe.Util.Log.Logger log = KSPe.Util.Log.Logger.CreateForType<CustomConfigsManager>();
40+
private static void Log(String s)
3241
{
33-
print("[CustomConfigsManager] " + s);
42+
log.info(s);
3443
}
3544

3645
}

0 commit comments

Comments
 (0)