Surface attached parts with crossfeed set themselves as fuel targets on parent parts. Fixes issue #67
[VesselSimulator.git] / KerbalEngineer / VesselSimulator / PartSim.cs
blob:a/KerbalEngineer/VesselSimulator/PartSim.cs -> blob:b/KerbalEngineer/VesselSimulator/PartSim.cs
--- a/KerbalEngineer/VesselSimulator/PartSim.cs
+++ b/KerbalEngineer/VesselSimulator/PartSim.cs
@@ -679,6 +679,11 @@
                 if (partSimLookup.TryGetValue(part.parent, out parent))
                 {
                     if (log != null) log.buf.AppendLine("Parent part is " + parent.name + ":" + parent.partId);
+                    if (part.attachMode == AttachModes.SRF_ATTACH && part.attachRules.srfAttach && part.fuelCrossFeed && parent.fuelCrossFeed)
+                    {
+                        if (log != null) log.buf.AppendLine("Added " + name + " to " + parent.name + " fuel targets. (srf_attach with crossfeed)");
+                        parent.fuelTargets.Add(this);
+                    }
                 }
                 else
                 {