Skip to content

Commit

Permalink
Per Snjo, add OnDestroy handler. Disable for stretchies.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKell committed Apr 13, 2014
1 parent 61ab50a commit 59ade84
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,4 @@ UpgradeLog*.htm

# Microsoft Fakes
FakesAssemblies/
*.dll
4 changes: 2 additions & 2 deletions CrossFeedEnabler/AddToRadialTanks.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
}
}
@PART[*]:HAS[@MODULE[StretchyTanks]]
foo@PART[*]:HAS[@MODULE[StretchyTanks]]
{
MODULE
{
name = ModuleCrossFeed
}
}
@PART[*]:HAS[@MODULE[StretchyConicTank]]
foo@PART[*]:HAS[@MODULE[StretchyConicTank]]
{
MODULE
{
Expand Down
2 changes: 1 addition & 1 deletion CrossFeedEnabler/Readme_CFE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Crossfeed Enabler
by NathanKell

Adds a crossfeed between the part it's added to, and the part this part is surface-attached to. Use it for radial tanks.
A partmodule: adds a fuel crossfeed between the part it's added to, and the part this part is surface-attached to. Use it for radial tanks.

License CC-BY-SA
Source on GitHub at https://github.com/NathanKell/CrossFeedEnabler/
Expand Down
9 changes: 9 additions & 0 deletions Source/CrossFeedEnabler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,14 @@ public override void OnInitialize()
part.fuelLookupTargets.Add(part.parent);
}
}

public void OnDestroy()
{
if (part.parent != null && part.parent.fuelLookupTargets != null)
{
if (part.parent.fuelLookupTargets.Contains(this.part))
part.parent.fuelLookupTargets.Remove(this.part);
}
}
}
}

0 comments on commit 59ade84

Please sign in to comment.