From 1201b93c2e63742ce96e92ae53a5464bc2995575 Mon Sep 17 00:00:00 2001 From: Clayel Date: Sat, 2 May 2026 12:27:07 -0400 Subject: [PATCH 1/5] watchdogs --- Source/Watchdogs.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Watchdogs.cs b/Source/Watchdogs.cs index 99ae6319..d748b399 100644 --- a/Source/Watchdogs.cs +++ b/Source/Watchdogs.cs @@ -1,5 +1,6 @@ using UnityEngine; using UnityEngine.Rendering; +using System.Linq; namespace RealSolarSystem { @@ -19,8 +20,7 @@ public class RSSWatchDog : MonoBehaviour public void Start() { - foreach (ConfigNode node in GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM")) - rssSettings = node; + rssSettings = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("ClipPlanes")); GameEvents.onVesselSOIChanged.Add(OnVesselSOIChanged); GameEvents.onVesselSituationChange.Add(OnVesselSituationChanged); @@ -47,7 +47,9 @@ public void Update() Camera[] cameras = Camera.allCameras; string bodyName = FlightGlobals.getMainBody().name; - ConfigNode clipPlaneSettings; + if (rssSettings == null) return; + + ConfigNode clipPlaneSettings = null; if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11 || SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D12) { From a0a6c902437ad04d2a5036d5af3345579e8f4184 Mon Sep 17 00:00:00 2001 From: Clayel Date: Sat, 2 May 2026 12:30:43 -0400 Subject: [PATCH 2/5] rssrunwayfix --- GameData/RealSolarSystem/RealSolarSystem.cfg | 10 +++++----- Source/RSSRunwayFix.cs | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/GameData/RealSolarSystem/RealSolarSystem.cfg b/GameData/RealSolarSystem/RealSolarSystem.cfg index aff4f7cc..dd35efb3 100644 --- a/GameData/RealSolarSystem/RealSolarSystem.cfg +++ b/GameData/RealSolarSystem/RealSolarSystem.cfg @@ -28,10 +28,10 @@ REALSOLARSYSTEM rate6 = 1000000 rate7 = 6000000 } -} -RSSRUNWAYFIX -{ - debug = false - holdThreshold = 2700 + RSSRUNWAYFIX + { + debug = false + holdThreshold = 2700 + } } diff --git a/Source/RSSRunwayFix.cs b/Source/RSSRunwayFix.cs index 60562d37..2af6fd94 100644 --- a/Source/RSSRunwayFix.cs +++ b/Source/RSSRunwayFix.cs @@ -1,4 +1,5 @@ using System.Collections; +using System.Linq; using UnityEngine; using static RunwayCollisionHandler; @@ -43,17 +44,16 @@ public void Awake() public void Start() { - foreach (ConfigNode n in GameDatabase.Instance.GetConfigNodes("RSSRUNWAYFIX")) + ConfigNode node = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("RSSRUNWAYFIX")); + + if (bool.TryParse(node.GetValue("debug"), out bool bTemp)) { - if (bool.TryParse(n.GetValue("debug"), out bool bTemp)) - { - debug = bTemp; - } + debug = bTemp; + } - if (float.TryParse(n.GetValue("holdThreshold"), out float fTemp)) - { - holdThreshold = fTemp; - } + if (float.TryParse(node.GetValue("holdThreshold"), out float fTemp)) + { + holdThreshold = fTemp; } GameEvents.onVesselGoOffRails.Add(OnVesselGoOffRails); From e80b25d7a7aebc27defab123bf0697f753759c59 Mon Sep 17 00:00:00 2001 From: Clayel Date: Sat, 2 May 2026 12:33:29 -0400 Subject: [PATCH 3/5] commnetfixer --- Source/CommNetFixer.cs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Source/CommNetFixer.cs b/Source/CommNetFixer.cs index eb053b9c..8e05164d 100644 --- a/Source/CommNetFixer.cs +++ b/Source/CommNetFixer.cs @@ -1,5 +1,6 @@ using CommNet; using System; +using System.Linq; using UnityEngine; namespace RealSolarSystem @@ -19,23 +20,25 @@ public void Start() Debug.Log("[RealSolarSystem] Checking for custom CommNet settings..."); - foreach (ConfigNode RSSSettings in GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM")) - { - RSSSettings.TryGetValue("overrideCommNetParams", ref overrideCommNetParams); - RSSSettings.TryGetValue("enableGroundStations", ref enableExtraGroundStations); - RSSSettings.TryGetValue("occlusionMultiplierAtm", ref occlusionMultiplierInAtm); - RSSSettings.TryGetValue("occlusionMultiplierVac", ref occlusionMultiplierInVac); - } + ConfigNode node = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(); - if (overrideCommNetParams) + if (node != null) { - // Set the default CommNet parameters for RealSolarSystem. + node.TryGetValue("overrideCommNetParams", ref overrideCommNetParams); + node.TryGetValue("enableGroundStations", ref enableExtraGroundStations); + node.TryGetValue("occlusionMultiplierAtm", ref occlusionMultiplierInAtm); + node.TryGetValue("occlusionMultiplierVac", ref occlusionMultiplierInVac); + + if (overrideCommNetParams) + { + // Set the default CommNet parameters for RealSolarSystem. - Debug.Log("[RealSolarSystem] Updating the CommNet settings..."); + Debug.Log("[RealSolarSystem] Updating the CommNet settings..."); - HighLogic.CurrentGame.Parameters.CustomParams().enableGroundStations = enableExtraGroundStations; - HighLogic.CurrentGame.Parameters.CustomParams().occlusionMultiplierAtm = occlusionMultiplierInAtm; - HighLogic.CurrentGame.Parameters.CustomParams().occlusionMultiplierVac = occlusionMultiplierInVac; + HighLogic.CurrentGame.Parameters.CustomParams().enableGroundStations = enableExtraGroundStations; + HighLogic.CurrentGame.Parameters.CustomParams().occlusionMultiplierAtm = occlusionMultiplierInAtm; + HighLogic.CurrentGame.Parameters.CustomParams().occlusionMultiplierVac = occlusionMultiplierInVac; + } } } catch (Exception exceptionStack) From e9a9423b1687d2f58694a59cb7f1ceded4973f04 Mon Sep 17 00:00:00 2001 From: Clayel Date: Sat, 2 May 2026 12:36:24 -0400 Subject: [PATCH 4/5] null check for rssrunwayfix --- Source/RSSRunwayFix.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/RSSRunwayFix.cs b/Source/RSSRunwayFix.cs index 2af6fd94..075cb09d 100644 --- a/Source/RSSRunwayFix.cs +++ b/Source/RSSRunwayFix.cs @@ -46,14 +46,17 @@ public void Start() { ConfigNode node = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("RSSRUNWAYFIX")); - if (bool.TryParse(node.GetValue("debug"), out bool bTemp)) + if (node != null) { - debug = bTemp; - } + if (bool.TryParse(node.GetValue("debug"), out bool bTemp)) + { + debug = bTemp; + } - if (float.TryParse(node.GetValue("holdThreshold"), out float fTemp)) - { - holdThreshold = fTemp; + if (float.TryParse(node.GetValue("holdThreshold"), out float fTemp)) + { + holdThreshold = fTemp; + } } GameEvents.onVesselGoOffRails.Add(OnVesselGoOffRails); From 7d411ff8ea480b28f8f9754422693642ad25a9b5 Mon Sep 17 00:00:00 2001 From: Clayel Date: Sat, 2 May 2026 17:23:58 -0400 Subject: [PATCH 5/5] actually grab the right node (made this mistake in timewarpfixer too) --- Source/RSSRunwayFix.cs | 2 +- Source/TimeWarpFixer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/RSSRunwayFix.cs b/Source/RSSRunwayFix.cs index 075cb09d..d041282d 100644 --- a/Source/RSSRunwayFix.cs +++ b/Source/RSSRunwayFix.cs @@ -44,7 +44,7 @@ public void Awake() public void Start() { - ConfigNode node = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("RSSRUNWAYFIX")); + ConfigNode node = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("RSSRUNWAYFIX"))?.GetNode("RSSRUNWAYFIX"); if (node != null) { diff --git a/Source/TimeWarpFixer.cs b/Source/TimeWarpFixer.cs index f2e1326d..856c3253 100644 --- a/Source/TimeWarpFixer.cs +++ b/Source/TimeWarpFixer.cs @@ -25,7 +25,7 @@ public void Update() { fixedTimeWarp = true; - ConfigNode twNode = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("timeWarpRates")); + ConfigNode twNode = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("timeWarpRates"))?.GetNode("timeWarpRates"); if (twNode != null) {