From 56b432a2a71786a7475c76c7746dfc6ab7fcc0b1 Mon Sep 17 00:00:00 2001 From: severedsolo Date: Sat, 22 Dec 2018 14:24:13 +0000 Subject: [PATCH] Fixed SRB failures being allowed in KRASH sims (for real this time) --- .gitignore | 2 + .idea/.idea.OhScrap/riderModule.iml | 8 ++++ GameData/Severedsolo/OhScrap/Changelog.cfg | 10 +++- GameData/Severedsolo/OhScrap/OhScrap.version | 2 +- OhScrap.sln.DotSettings.user | 10 ++++ OhScrap/BaseFailureModule.cs | 2 + OhScrap/OhScrap.csproj | 15 ++++++ OhScrap/SRBFailureModule.cs | 5 +- .../Debug/OhScrap.csproj.FileListAbsolute.txt | 17 +++++++ .../OhScrap.csproj.FileListAbsolute.txt | 48 ++++++++++++------- 10 files changed, 99 insertions(+), 20 deletions(-) create mode 100644 .idea/.idea.OhScrap/riderModule.iml create mode 100644 OhScrap.sln.DotSettings.user diff --git a/.gitignore b/.gitignore index a3c4ba7..52058d0 100644 --- a/.gitignore +++ b/.gitignore @@ -63,3 +63,5 @@ UPFM/Untitled Part Failure Mod/obj/Release/build.force GameData/KerbalChangelog/KerbalChangelog.version GameData/KerbalChangelog/KerbalChangelogChangelogv1-1-2.cfg GameData/KerbalChangelog/LICENSE +OhScrap/obj/Debug/OhScrap.csproj.FileListAbsolute.txt +OhScrap/obj/Release/OhScrap.csproj.FileListAbsolute.txt diff --git a/.idea/.idea.OhScrap/riderModule.iml b/.idea/.idea.OhScrap/riderModule.iml new file mode 100644 index 0000000..468d82c --- /dev/null +++ b/.idea/.idea.OhScrap/riderModule.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/GameData/Severedsolo/OhScrap/Changelog.cfg b/GameData/Severedsolo/OhScrap/Changelog.cfg index 296e148..4ad7fb3 100644 --- a/GameData/Severedsolo/OhScrap/Changelog.cfg +++ b/GameData/Severedsolo/OhScrap/Changelog.cfg @@ -2,6 +2,14 @@ KERBALCHANGELOG //Required to have this name { showChangelog = True //To show the changelog, this must be set to True modName = OhScrap //Add your mod's name here + + VERSION //Declares a version node + { + version = 1.4.2 //Version number, numbers only with no spaces! + change = Fixed SRBs being allowed to fail during KRASH simulations (for real this time) + } + + VERSION //Declares a version node { version = 1.4.1 //Version number, numbers only with no spaces! @@ -32,4 +40,4 @@ change = You can also see this information in the UI by creating an empty text f change = Probably a bunch of other stuff I'm not remembering right now. change = Added option to override Stage Recovery and recover parts but no funds. Please note this is highly experimental and may not even work at all. } -} \ No newline at end of file +} diff --git a/GameData/Severedsolo/OhScrap/OhScrap.version b/GameData/Severedsolo/OhScrap/OhScrap.version index 8fe5f4f..4d796f4 100644 --- a/GameData/Severedsolo/OhScrap/OhScrap.version +++ b/GameData/Severedsolo/OhScrap/OhScrap.version @@ -11,7 +11,7 @@ { "MAJOR" : 1, "MINOR" : 4, - "PATCH" : 1, + "PATCH" : 2, "BUILD" : 0 }, "KSP_VERSION" : diff --git a/OhScrap.sln.DotSettings.user b/OhScrap.sln.DotSettings.user new file mode 100644 index 0000000..1248ec0 --- /dev/null +++ b/OhScrap.sln.DotSettings.user @@ -0,0 +1,10 @@ + + True + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="False" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + True + True \ No newline at end of file diff --git a/OhScrap/BaseFailureModule.cs b/OhScrap/BaseFailureModule.cs index 009d414..4787714 100644 --- a/OhScrap/BaseFailureModule.cs +++ b/OhScrap/BaseFailureModule.cs @@ -63,6 +63,7 @@ private void Start() ScrapYardEvents.OnSYTrackerUpdated.Add(OnSYTrackerUpdated); ScrapYardEvents.OnSYInventoryAppliedToVessel.Add(OnSYInventoryAppliedToVessel); ScrapYardEvents.OnSYInventoryAppliedToPart.Add(OnSYInventoryAppliedToPart); + ScrapYardEvents.OnSYInventoryChanged.Add(OnSYInventoryChanged); OhScrap = part.FindModuleImplementing(); //refresh part if we are in the editor and parts never been used before (just returns if not) OhScrap.RefreshPart(); @@ -109,6 +110,7 @@ private void OnSYTrackerUpdated(IEnumerable data) private void ActivateFailures() { + if(KRASHWrapper.simulationActive()) return; launched = true; Initialise(); UPFMUtils.instance.testedParts.Add(SYP.ID); diff --git a/OhScrap/OhScrap.csproj b/OhScrap/OhScrap.csproj index 74a30ed..b59b947 100644 --- a/OhScrap/OhScrap.csproj +++ b/OhScrap/OhScrap.csproj @@ -35,6 +35,15 @@ false + + ..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll + + + ..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp-firstpass.dll + + + ..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\GameData\ScrapYard\ScrapYard.dll + @@ -50,12 +59,18 @@ C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll + + ..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll + C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\GameData\ScrapYard\ScrapYard.dll + + ..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll + diff --git a/OhScrap/SRBFailureModule.cs b/OhScrap/SRBFailureModule.cs index 50add0b..8faa0aa 100644 --- a/OhScrap/SRBFailureModule.cs +++ b/OhScrap/SRBFailureModule.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using UnityEngine; +using System.Runtime.CompilerServices; namespace OhScrap { @@ -31,6 +32,7 @@ public override bool FailureAllowed() //Part will just shutdown and not be restartable. public override void FailPart() { + if (KRASHWrapper.simulationActive()) return; if (engine.currentThrottle == 0) return; engine.allowShutdown = true; engine.allowRestart = false; @@ -44,7 +46,8 @@ public override void FailPart() if (OhScrap.highlight) OhScrap.SetFailedHighlight(); CancelInvoke("FailPart"); } - //SRBs cant be reoaired. + + //SRBs cant be repaired. public override void RepairPart() { ScreenMessages.PostScreenMessage("Igniting an SRB manually doesn't seem like a good idea"); diff --git a/OhScrap/obj/Debug/OhScrap.csproj.FileListAbsolute.txt b/OhScrap/obj/Debug/OhScrap.csproj.FileListAbsolute.txt index 2960683..502de10 100644 --- a/OhScrap/obj/Debug/OhScrap.csproj.FileListAbsolute.txt +++ b/OhScrap/obj/Debug/OhScrap.csproj.FileListAbsolute.txt @@ -50,3 +50,20 @@ D:/OneDrive/Documents/Github/OhScrap/OhScrap/obj/Debug/OhScrap.pdb /home/martin/.steam/steam/steamapps/common/OhScrap-master/OhScrap/obj/Debug/OhScrap.csproj.CopyComplete /home/martin/.steam/steam/steamapps/common/OhScrap-master/OhScrap/obj/Debug/OhScrap.dll /home/martin/.steam/steam/steamapps/common/OhScrap-master/OhScrap/obj/Debug/OhScrap.pdb +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/OhScrap.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/OhScrap.pdb +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/Assembly-CSharp-firstpass.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/Assembly-CSharp.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/ScrapYard.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/UnityEngine.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/UnityEngine.UI.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/KSPTrackIR.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/KSPAssets.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/Mono.Cecil.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/Ionic.Zip.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Debug/UnityEngine.dll.mdb +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Debug/OhScrap.csprojAssemblyReference.cache +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Debug/OhScrap.csproj.CoreCompileInputs.cache +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Debug/OhScrap.csproj.CopyComplete +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Debug/OhScrap.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Debug/OhScrap.pdb diff --git a/OhScrap/obj/Release/OhScrap.csproj.FileListAbsolute.txt b/OhScrap/obj/Release/OhScrap.csproj.FileListAbsolute.txt index 8c89e69..a47208f 100644 --- a/OhScrap/obj/Release/OhScrap.csproj.FileListAbsolute.txt +++ b/OhScrap/obj/Release/OhScrap.csproj.FileListAbsolute.txt @@ -33,20 +33,34 @@ C:/Users/evilp/source/repos/OhScrap/OhScrap/obj/Release/OhScrap.csprojAssemblyRe /home/martin/.steam/steam/steamapps/common/OhScrap-master/OhScrap/obj/Release/OhScrap.dll /home/martin/.steam/steam/steamapps/common/OhScrap-master/OhScrap/obj/Release/OhScrap.pdb /home/martin/.steam/steam/steamapps/common/OhScrap-master/OhScrap/obj/Release/OhScrap.csprojAssemblyReference.cache -D:\OneDrive\Documents\Github\OhScrap\OhScrap\obj\Release\OhScrap.csprojAssemblyReference.cache -D:\OneDrive\Documents\Github\OhScrap\OhScrap\obj\Release\OhScrap.csproj.CoreCompileInputs.cache -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\OhScrap.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\OhScrap.pdb -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\Assembly-CSharp-firstpass.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\Assembly-CSharp.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\ScrapYard.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\UnityEngine.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\UnityEngine.UI.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\KSPTrackIR.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\KSPAssets.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\Mono.Cecil.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\Ionic.Zip.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\bin\Release\TDx.TDxInput.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\obj\Release\OhScrap.csproj.CopyComplete -D:\OneDrive\Documents\Github\OhScrap\OhScrap\obj\Release\OhScrap.dll -D:\OneDrive\Documents\Github\OhScrap\OhScrap\obj\Release\OhScrap.pdb +D:/OneDrive/Documents/Github/OhScrap/OhScrap/obj/Release/OhScrap.csprojAssemblyReference.cache +D:/OneDrive/Documents/Github/OhScrap/OhScrap/obj/Release/OhScrap.csproj.CoreCompileInputs.cache +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/OhScrap.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/OhScrap.pdb +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/Assembly-CSharp-firstpass.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/Assembly-CSharp.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/ScrapYard.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/UnityEngine.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/UnityEngine.UI.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/KSPTrackIR.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/KSPAssets.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/Mono.Cecil.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/Ionic.Zip.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/bin/Release/TDx.TDxInput.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/obj/Release/OhScrap.csproj.CopyComplete +D:/OneDrive/Documents/Github/OhScrap/OhScrap/obj/Release/OhScrap.dll +D:/OneDrive/Documents/Github/OhScrap/OhScrap/obj/Release/OhScrap.pdb +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/OhScrap.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/OhScrap.pdb +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/UnityEngine.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/UnityEngine.UI.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/KSPTrackIR.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/KSPAssets.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/Mono.Cecil.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/Ionic.Zip.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/bin/Release/UnityEngine.dll.mdb +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.csprojAssemblyReference.cache +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.csproj.CoreCompileInputs.cache +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.csproj.CopyComplete +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.dll +/home/martin/Documents/GitHub/OhScrap/OhScrap/obj/Release/OhScrap.pdb