Skip to content

Commit

Permalink
Fixed SRB failures being allowed in KRASH sims (for real this time)
Browse files Browse the repository at this point in the history
  • Loading branch information
severedsolo committed Dec 22, 2018
1 parent ff15640 commit 56b432a
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions .idea/.idea.OhScrap/riderModule.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion GameData/Severedsolo/OhScrap/Changelog.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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.
}
}
}
2 changes: 1 addition & 1 deletion GameData/Severedsolo/OhScrap/OhScrap.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"MAJOR" : 1,
"MINOR" : 4,
"PATCH" : 1,
"PATCH" : 2,
"BUILD" : 0
},
"KSP_VERSION" :
Expand Down
10 changes: 10 additions & 0 deletions OhScrap.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/IsNotificationDisabled/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Method/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=TypesAndNamespaces/@EntryIndexedValue">&lt;Policy Inspect="False" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Locals/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Parameters/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=PublicFields/@EntryIndexedValue">&lt;Policy Inspect="False" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/AutoDetectedNamingRules/=Property/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpNaming/ApplyAutoDetectedRules/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/IsNamingAutoDetectionCompleted/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 2 additions & 0 deletions OhScrap/BaseFailureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ModuleUPFMEvents>();
//refresh part if we are in the editor and parts never been used before (just returns if not)
OhScrap.RefreshPart();
Expand Down Expand Up @@ -109,6 +110,7 @@ private void OnSYTrackerUpdated(IEnumerable<InventoryPart> data)

private void ActivateFailures()
{
if(KRASHWrapper.simulationActive()) return;
launched = true;
Initialise();
UPFMUtils.instance.testedParts.Add(SYP.ID);
Expand Down
15 changes: 15 additions & 0 deletions OhScrap/OhScrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="ScrapYard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\GameData\ScrapYard\ScrapYard.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
Expand All @@ -50,12 +59,18 @@
<Reference Include="UnityEngine">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="ScrapYard">
<HintPath>C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program - ModDev\GameData\ScrapYard\ScrapYard.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<HintPath>..\..\..\..\.steam\steam\steamapps\common\Kerbal Space Program\KSP_Data\Managed\UnityEngine.UI.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AntennaFailureModule.cs" />
Expand Down
5 changes: 4 additions & 1 deletion OhScrap/SRBFailureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using UnityEngine;
using System.Runtime.CompilerServices;

namespace OhScrap
{
Expand Down Expand Up @@ -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;
Expand All @@ -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");
Expand Down
17 changes: 17 additions & 0 deletions OhScrap/obj/Debug/OhScrap.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
48 changes: 31 additions & 17 deletions OhScrap/obj/Release/OhScrap.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 56b432a

Please sign in to comment.