Skip to content

Commit

Permalink
Don't reset resource nodes at every load
Browse files Browse the repository at this point in the history
This fixes the issue with Extraplanetary Launchpads

Also possibly some issues with USI Tools inflatables, although I have not been able to replicate those
  • Loading branch information
Ramarren committed Jan 24, 2015
1 parent 842262a commit a1951d2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Firespitter/customization/FSfuelSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class FSfuelSwitch : PartModule, IPartCostModifier
[KSPField(isPersistant = true)]
public Vector4 currentAmounts = Vector4.zero;
[KSPField(isPersistant = true)]
public int selectedTankSetup = 0;
public int selectedTankSetup = -1;
[KSPField(isPersistant = true)]
public bool hasLaunched = false;
[KSPField]
Expand All @@ -51,7 +51,11 @@ public class FSfuelSwitch : PartModule, IPartCostModifier
public override void OnStart(PartModule.StartState state)
{
initializeData();
assignResourcesToPart(false);
if (selectedTankSetup == -1)
{
selectedTankSetup = 0;
assignResourcesToPart(false);
}
brandNewPart = false;
}

Expand Down Expand Up @@ -101,8 +105,11 @@ public void nextTankSetupEvent()
public void selectTankSetup(int i, bool calledByPlayer)
{
initializeData();
selectedTankSetup = i;
assignResourcesToPart(calledByPlayer);
if (selectedTankSetup != i)
{
selectedTankSetup = i;
assignResourcesToPart(calledByPlayer);
}
}

private void assignResourcesToPart(bool calledByPlayer)
Expand Down
Binary file modified For release/Firespitter/Plugins/Firespitter.dll
Binary file not shown.

0 comments on commit a1951d2

Please sign in to comment.