From c702a97a02b97d1e969d5f9c3bcb33e65cc927ae Mon Sep 17 00:00:00 2001 From: severedsolo Date: Sun, 20 May 2018 08:42:02 +0100 Subject: [PATCH] Release 1.3.5 --- GameData/Severedsolo/OhScrap/OhScrap.version | 2 +- OhScrap/BaseFailureModule.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/GameData/Severedsolo/OhScrap/OhScrap.version b/GameData/Severedsolo/OhScrap/OhScrap.version index b19a67c..1e5ec0a 100644 --- a/GameData/Severedsolo/OhScrap/OhScrap.version +++ b/GameData/Severedsolo/OhScrap/OhScrap.version @@ -11,7 +11,7 @@ { "MAJOR" : 1, "MINOR" : 3, - "PATCH" : 4, + "PATCH" : 5, "BUILD" : 0 }, "KSP_VERSION" : diff --git a/OhScrap/BaseFailureModule.cs b/OhScrap/BaseFailureModule.cs index a6fd987..29d919b 100644 --- a/OhScrap/BaseFailureModule.cs +++ b/OhScrap/BaseFailureModule.cs @@ -74,6 +74,7 @@ private void Start() //listen to ScrapYard Events so we can recalculate when needed ScrapYardEvents.OnSYTrackerUpdated.Add(OnSYTrackerUpdated); ScrapYardEvents.OnSYInventoryAppliedToVessel.Add(OnSYInventoryAppliedToVessel); + 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(); @@ -82,7 +83,14 @@ private void Start() GameEvents.onLaunch.Add(OnLaunch); } - + + private void OnSYInventoryChanged(InventoryPart data0, bool data1) + { + willFail = false; + chanceOfFailure = baseChanceOfFailure; + Initialise(); + } + // if SY applies inventory we reset the module as it could be a whole new part now. private void OnSYInventoryAppliedToVessel() {