Skip to content

Commit

Permalink
Listen to onLaunch rather than onStageActivated
Browse files Browse the repository at this point in the history
  • Loading branch information
severedsolo committed May 21, 2017
1 parent 8dbd9b7 commit c3bc151
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions UPFM/Untitled Part Failure Mod/BaseFailureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<DontRecoverMe>();
if(dontRecover == null) return;
if (dontRecover == null) return;
part.RemoveModule(dontRecover);
Debug.Log("[UPFM]: " + part.name + "marked as recoverable");
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit c3bc151

Please sign in to comment.