Skip to content

Commit

Permalink
Resolves #15 (non-staged decouplers getting offset) and bigorangemach…
Browse files Browse the repository at this point in the history
…ine#16 (KV-X pods getting offset sideways).
  • Loading branch information
Kerbas-ad-astra committed Nov 10, 2019
1 parent 734794b commit 4943145
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions KronalVesselViewer/VesselViewConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ private void StackDecouplerExplode(VesselElementViewOptions ol, VesselElementVie

var module = part.Module<ModuleDecouple>();
if (module.isDecoupled) return;
if (!module.staged) return;
if (!module.stagingEnabled) return;
if (!part.parent) return;
Vector3 dir;
if (module.isOmniDecoupler)
Expand All @@ -460,7 +460,7 @@ private void RadialDecouplerExplode(VesselElementViewOptions ol, VesselElementVi

var module = part.Module<ModuleAnchoredDecoupler>();
if (module.isDecoupled) return;
if (!module.staged) return;
if (!module.stagingEnabled) return;
if (string.IsNullOrEmpty(module.explosiveNodeID)) return;
var an = module.explosiveNodeID == "srf" ? part.srfAttachNode : part.FindAttachNode(module.explosiveNodeID);
if (an == null || an.attachedPart == null) return;
Expand All @@ -479,7 +479,13 @@ private void RadialDecouplerExplode(VesselElementViewOptions ol, VesselElementVi
{
partToBeMoved = an.attachedPart;
}
partToBeMoved.transform.Translate(part.transform.right * distance, Space.World);
if (part.name.StartsWith("kv") && part.name.EndsWith("Pod"))
{
partToBeMoved.transform.Translate(-1 * part.transform.up * distance, Space.World);
}
else
partToBeMoved.transform.Translate(part.transform.right * distance, Space.World);

}

private void DockingPortExplode(VesselElementViewOptions ol, VesselElementViewOption o, Part part)
Expand Down

0 comments on commit 4943145

Please sign in to comment.