diff --git a/GameData/RealSolarSystem/Compatibility/TimeWarp.cfg b/GameData/RealSolarSystem/Compatibility/TimeWarp.cfg new file mode 100644 index 00000000..b36ddc6d --- /dev/null +++ b/GameData/RealSolarSystem/Compatibility/TimeWarp.cfg @@ -0,0 +1,15 @@ +// No need to override the user's settings when using BetterTimeWarp or TimeControl + +RealSolarSystem:NEEDS[!BetterTimeWarpCont&!TimeControl] +{ + timeWarpRates + { + rate1 = 10 + rate2 = 100 + rate3 = 1000 + rate4 = 10000 + rate5 = 100000 + rate6 = 1000000 + rate7 = 6000000 + } +} diff --git a/GameData/RealSolarSystem/RealSolarSystem.cfg b/GameData/RealSolarSystem/RealSolarSystem.cfg index aff4f7cc..7acd1a3c 100644 --- a/GameData/RealSolarSystem/RealSolarSystem.cfg +++ b/GameData/RealSolarSystem/RealSolarSystem.cfg @@ -17,17 +17,6 @@ REALSOLARSYSTEM cam01FarClip = 1875000 } } - - timeWarpRates - { - rate1 = 10 - rate2 = 100 - rate3 = 1000 - rate4 = 10000 - rate5 = 100000 - rate6 = 1000000 - rate7 = 6000000 - } } RSSRUNWAYFIX diff --git a/Source/TimeWarpFixer.cs b/Source/TimeWarpFixer.cs index 1bb3400d..f2e1326d 100644 --- a/Source/TimeWarpFixer.cs +++ b/Source/TimeWarpFixer.cs @@ -1,4 +1,5 @@ -using UnityEngine; +using System.Linq; +using UnityEngine; namespace RealSolarSystem { @@ -23,15 +24,13 @@ public void Update() if (!fixedTimeWarp && TimeWarp.fetch != null) { fixedTimeWarp = true; - ConfigNode twNode = null; - foreach (ConfigNode node in GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM")) - twNode = node.GetNode("timeWarpRates"); - - Debug.Log("[RealSolarSystem] Setting TimeWarp rates..."); + ConfigNode twNode = GameDatabase.Instance.GetConfigNodes("REALSOLARSYSTEM").FirstOrDefault(n => n.HasNode("timeWarpRates")); if (twNode != null) { + Debug.Log("[RealSolarSystem] Setting TimeWarp rates..."); + for (int i = 1; i < 8; i++) { if (twNode.HasValue("rate" + i))