Skip to content

Commit

Permalink
Remove RealChute auto-arm default setting clobbering.
Browse files Browse the repository at this point in the history
Should no longer be necessary.
  • Loading branch information
siimav committed Jun 2, 2024
1 parent 2a8a0e2 commit 029b036
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions Source/RP0/ScenarioModules/FirstStart.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using UnityEngine;

namespace RP0
Expand Down Expand Up @@ -31,7 +29,6 @@ private void Start()
}

ScienceUtils.MarkExperimentsAsDone(Database.StartCompletedExperiments);
ClobberRealChuteDefaultSettings();
CopyCraftFiles();
UnlockCreditHandler.Instance.IncrementCredit("start", HighLogic.CurrentGame.Parameters.CustomParams<RP0Settings>().StartingUnlockCredit);

Expand All @@ -55,25 +52,6 @@ private static void UnlockStartingPartsTechNode()
}
}

private void ClobberRealChuteDefaultSettings()
{
var rcAssembly = AssemblyLoader.loadedAssemblies.FirstOrDefault(a => a.assembly.GetName().Name == "RealChute");
if (rcAssembly != null &&
rcAssembly.assembly.GetType("RealChute.RealChuteSettings") is Type rcSettings &&
rcSettings.GetProperty("Instance", BindingFlags.Static | BindingFlags.Public) is PropertyInfo instancePInf &&
rcSettings.GetProperty("AutoArm", BindingFlags.Instance | BindingFlags.Public) is PropertyInfo autoArmPInf &&
rcSettings.GetMethod("SaveSettings", BindingFlags.Static | BindingFlags.Public) is MethodInfo saveMInf)
{
object settingsInstance = instancePInf.GetValue(null);
autoArmPInf?.SetValue(settingsInstance, true);
saveMInf.Invoke(null, null);
}
else
{
RP0Debug.Log("FirstStart: RealChute not found");
}
}

private static void CopyCraftFiles()
{
try
Expand Down

0 comments on commit 029b036

Please sign in to comment.