diff --git a/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/ChangeLog.txt b/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/ChangeLog.txt index 6e3aae1..90c2e31 100644 --- a/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/ChangeLog.txt +++ b/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/ChangeLog.txt @@ -1,2 +1,4 @@ += v1.1.0 +- Extending to 2000km. Compiled for KSP 1.2.9 = v1.0.0 - Release \ No newline at end of file diff --git a/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/PhysicsRangeExtender.version b/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/PhysicsRangeExtender.version index 241d280..73db2c9 100644 --- a/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/PhysicsRangeExtender.version +++ b/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/PhysicsRangeExtender.version @@ -5,7 +5,7 @@ "CHANGE_LOG_URL":"https://github.com/jrodrigv/PhysicsRangeExtender/raw/master/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/ChangeLog.txt", "VERSION": { "MAJOR": 1, - "MINOR": 0, + "MINOR": 1, "PATCH": 0 }, "KSP_VERSION": { diff --git a/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/Plugins/PhysicsRangeExtender.dll b/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/Plugins/PhysicsRangeExtender.dll index 605d7bc..341a4aa 100644 Binary files a/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/Plugins/PhysicsRangeExtender.dll and b/PhysicsRangeExtender/Distribution/GameData/PhysicsRangeExtender/Plugins/PhysicsRangeExtender.dll differ diff --git a/PhysicsRangeExtender/PhysicsRangeExtender.cs b/PhysicsRangeExtender/PhysicsRangeExtender.cs index f8a33ce..886fd0e 100644 --- a/PhysicsRangeExtender/PhysicsRangeExtender.cs +++ b/PhysicsRangeExtender/PhysicsRangeExtender.cs @@ -6,17 +6,19 @@ namespace PhysicsRangeExtender [KSPAddon(KSPAddon.Startup.FlightAndKSC, false)] public class PhysicsRangeExtender : MonoBehaviour { - private readonly VesselRanges.Situation _maxSituation = new VesselRanges.Situation(181000, 190000, 200000, 172900); + private const int RangeInKm = 2000; + private readonly VesselRanges.Situation _maxSituation = new VesselRanges.Situation(RangeInKm * 1000 - 15, RangeInKm * 1000 - 10, RangeInKm*1000, RangeInKm * 1000 - 20); void Start() { - FloatingOrigin.fetch.threshold = Mathf.Pow(200000 + 3500, 2); + FloatingOrigin.fetch.threshold = Mathf.Pow(RangeInKm * 1000 + 3500, 2); GameEvents.onVesselSwitching.Add(ApplyPhysRange); GameEvents.onVesselCreate.Add(ApplyPhysRange); GameEvents.onVesselGoOnRails.Add(ApplyPhysRange); GameEvents.onVesselGoOffRails.Add(ApplyPhysRange); GameEvents.onVesselLoaded.Add(ApplyPhysRange); + GameEvents.onVesselSwitchingToUnloaded.Add(ApplyPhysRange); ApplyPhysRange(); @@ -36,18 +38,17 @@ public void ApplyPhysRange() { try { - foreach (var v in FlightGlobals.Vessels) - v.vesselRanges = new VesselRanges(new VesselRanges - { - escaping = _maxSituation, - flying = _maxSituation, - landed = _maxSituation, - orbit = _maxSituation, - prelaunch = _maxSituation, - splashed = _maxSituation, - subOrbital = _maxSituation - }); - + int vesselsCount = FlightGlobals.Vessels.Count; + for (int i = 0; i < vesselsCount; i++) + { + FlightGlobals.Vessels[i].vesselRanges.escaping = _maxSituation; + FlightGlobals.Vessels[i].vesselRanges.flying = _maxSituation; + FlightGlobals.Vessels[i].vesselRanges.landed = _maxSituation; + FlightGlobals.Vessels[i].vesselRanges.orbit = _maxSituation; + FlightGlobals.Vessels[i].vesselRanges.prelaunch = _maxSituation; + FlightGlobals.Vessels[i].vesselRanges.splashed = _maxSituation; + FlightGlobals.Vessels[i].vesselRanges.subOrbital = _maxSituation; + } } catch (Exception e) { diff --git a/PhysicsRangeExtender/PhysicsRangeExtender.csproj b/PhysicsRangeExtender/PhysicsRangeExtender.csproj index 59ddca6..a74124b 100644 --- a/PhysicsRangeExtender/PhysicsRangeExtender.csproj +++ b/PhysicsRangeExtender/PhysicsRangeExtender.csproj @@ -31,16 +31,12 @@ - G:\GAMES\KERBAL\Kerbal Space Program_DEV_12\KSP_x64_Data\Managed\Assembly-CSharp.dll + G:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\Assembly-CSharp.dll - - - - - - - G:\GAMES\KERBAL\Kerbal Space Program_DEV_12\KSP_x64_Data\Managed\UnityEngine.dll + + False + G:\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll diff --git a/PhysicsRangeExtender/Properties/AssemblyInfo.cs b/PhysicsRangeExtender/Properties/AssemblyInfo.cs index f9cb8a7..b284a62 100644 --- a/PhysicsRangeExtender/Properties/AssemblyInfo.cs +++ b/PhysicsRangeExtender/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0")] +[assembly: AssemblyVersion("1.1.0")]