From c3bc1518c40951e7b0eafa945efa5e108b6bd656 Mon Sep 17 00:00:00 2001 From: severedsolo Date: Sun, 21 May 2017 15:07:30 +0100 Subject: [PATCH] Listen to onLaunch rather than onStageActivated --- UPFM/Untitled Part Failure Mod/BaseFailureModule.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UPFM/Untitled Part Failure Mod/BaseFailureModule.cs b/UPFM/Untitled Part Failure Mod/BaseFailureModule.cs index 8b9cfce..19efc47 100644 --- a/UPFM/Untitled Part Failure Mod/BaseFailureModule.cs +++ b/UPFM/Untitled Part Failure Mod/BaseFailureModule.cs @@ -25,13 +25,13 @@ private void Start() part.AddModule("DontRecoverMe"); ScrapYardEvents.OnSYTrackerUpdated.Add(OnSYTrackerUpdated); Initialise(); - GameEvents.onStageActivate.Add(onStageActivate); + GameEvents.onLaunch.Add(onLaunch); } - private void onStageActivate(int data) + private void onLaunch(EventReport data) { PartModule dontRecover = part.FindModuleImplementing(); - if(dontRecover == null) return; + if (dontRecover == null) return; part.RemoveModule(dontRecover); Debug.Log("[UPFM]: " + part.name + "marked as recoverable"); } @@ -125,7 +125,7 @@ public void RepairChecks() private void OnDestroy() { - GameEvents.onStageActivate.Remove(onStageActivate); + GameEvents.onLaunch.Remove(onLaunch); if (ScrapYardEvents.OnSYTrackerUpdated == null) return; ScrapYardEvents.OnSYTrackerUpdated.Remove(OnSYTrackerUpdated); }