From 9ee05ca84b21ea9e2c495afaaebd3b14cf8fea90 Mon Sep 17 00:00:00 2001 From: Jesus Rodriguez Date: Sun, 2 Apr 2017 22:03:59 +0200 Subject: [PATCH] V1.1 --- .../PhysicsRangeExtender/ChangeLog.txt | 2 ++ .../PhysicsRangeExtender.version | 2 +- .../Plugins/PhysicsRangeExtender.dll | Bin 5632 -> 5632 bytes PhysicsRangeExtender/PhysicsRangeExtender.cs | 29 +++++++++--------- .../PhysicsRangeExtender.csproj | 12 +++----- .../Properties/AssemblyInfo.cs | 2 +- 6 files changed, 23 insertions(+), 24 deletions(-) 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 605d7bcd55209e1d46731f9aea18f46a9473e050..341a4aa5be1d898e0008882e42b9478ae0ba65cf 100644 GIT binary patch delta 1776 zcmZ`)ZERFU6g@L<`}Xy9yR>iHN?{AT-6CzN1wsi`6hTU0gG~!-p`@tPy41#Y7uvOz z&n=oD1QXf3sA%Gk5=pF@(557c#ve@#iP0Yt6GcUoG)74*@`Hq;k$Pqp35N7$_uM=8 z+`04S%$vNyn!%dmM~rV{movx8M1N*@tH0s_pb50q!0$#T9PsS`d>sF=2nf1iS>tXK z3&no-kVu!dvRK&${v~qoa5*rN3kbK}zrt;n9_L-n0|)(pUA`l8J?ie12hs=Ua42t? z5-|H5#>s$6RC+kBo_E{NT_SOf^94{?Iad`033f?d{W!Ba<4u+^wQru9ypPR12j(-J zfePKB()UaY-{J0|xTl#qMrNieW~LTk3vBOwt$AMa(faA>=}Q4$FZa01s=QxKT1dEr zYEh7t?&3uRiYUU{viwNodbE5*0V)VP81+@M`heQGtgLc>Gpf?74Ipw5_>kU1JtMJH zZ&#wTPjwsd0x9}POAHkjpq7ZNZ;3Y0*Kxd`j}dvSJNXR9%Gg(IEt3|H6!=RlLy0~O zgtDCCdFlX{LKXj@rup|u!=q2Sw$o^6=~_s=@Qqjnz@`$}s-N$i)=3 zEF_vJCEApJN)}+L#`J^QtpJ z0@UOvA{viC#XlPg>vZNdooQfv6X%Un5TaUsfDD%$p@wR&7S$N%5_$NJ7{D*YxtJzK zV2N5jcsVh>OuLmD*J@%TDoMn2rcGl9Hi)%&9=&2e>iMob%lK7z2LBVAN^6_o8^hln z`xwi0%;UVvzP!7Hw@BNlJLK&vNhY?$`}*SDv4O5s$8)@fPb6Cs-LBtSY_}x3QhU}V zI=d2MZPpp#Y;I3<#-oXiJ?M<5o{pyCJ+9v#a9w+{tSPasKb}ZwVr}vTMzK_TZwmcr zP7b*5=k*tq-taBIk?U#r^o>*J51+2-a+mlj(k(fVKA%sTzFf1|X_ro;(`XetaUJA@ zqzKODFq_W{38AO}0>aDc9^o|7?an$i%GDLSMF6JPuqL7?lErVs=2%0_7ryXNeyT0{$>oV} zPG5QN=Ge7-OE{0;{>G?TJ5?OYgiA!L8=f`p`V02vsynDmjAaVigjhN@SvW@L4h2>a TzYi>yFFrC>SoEjJEb;yeWZg5S delta 1759 zcmY+FZERCj7{~wT+^+5JO4k=k7%Q{e7<8<_$dEZuBW`n>I4Cv~7a%gU&LL}OTLwc$ zL6Zr-g>o^z@qxtvF%d#Ck)XtYSt7(QN;HbW1z%#2VF>C6!T9n&rwf^OaNft%|1t_O&W?IX zJ4#3s)uaat$*czr+E}L9rnyS9Q?rW1ck*>C!Z*ed?BN7ES;TJaL8;~@ zDE)$=7}1`z_S~)Yad{kXqSyF`8qLJtSyx5Mrc=tR(eJ>8ewljYd zv+EP%9Pb={Z;vl0<9uIO8_j-KOFYw@*xVaWb!C#)n0b9}cRcf0%e_)R2@3>r0 zk$`ViK1m5@2rA@acZDYg*L%dq>}3OL=@Os&}nL9#M;Flgh62OS}sV3jWC$!%*N zDOq%RkJT{c|1R;V^Kh&wcC75=*Y&^nTaWe*E#CU+fx3~P z+bO1mCSECO))H%BajA${?Zs!UgYJms_H0ux7Zn0Va-KCp)Q9igy>{q^KU{{s2Y NJtN+!*F~<@@gFN@H5&i` 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")]