Skip to content

Commit

Permalink
Ambarrasing missed borderline situation where the scaled part has **n…
Browse files Browse the repository at this point in the history
…o** attached parts to be dealt.

Fixes:
#163

Don't fix, but it's related to:
#131
#139
#167
#175
https://github.com/net-lisias-ksp/TweakScale/issues/176
  • Loading branch information
Lisias committed Oct 24, 2021
1 parent afa3d60 commit 2965f4c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/PartDB1122/PartDB/VariantPartScaler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected void MovePart(AttachNode node)
{
Vector3 currentPosition = this.part.partTransform.InverseTransformPoint(node.attachedPart.partTransform.position); // Where we are
Vector3 desiredPosition = currentNodesWithSameId[0].position; // Where we should be
Vector3 deltaPos = desiredPosition - currentPosition - attachedPartNode[0].position;
Vector3 deltaPos = desiredPosition - currentPosition - (attachedPartNode.Length > 0 ? attachedPartNode[0].position : Vector3.zero);

bool isAttachedParent = node.attachedPart == this.part.parent;
if (isAttachedParent) {
Expand Down
2 changes: 1 addition & 1 deletion Source/PartDB14x/PartDB/VariantPartScaler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected void MovePart(AttachNode node)
{
Vector3 currentPosition = this.part.partTransform.InverseTransformPoint(node.attachedPart.partTransform.position); // Where we are
Vector3 desiredPosition = currentNodesWithSameId[0].position; // Where we should be
Vector3 deltaPos = desiredPosition - currentPosition - attachedPartNode[0].position;
Vector3 deltaPos = desiredPosition - currentPosition - (attachedPartNode.Length > 0 ? attachedPartNode[0].position : Vector3.zero);

bool isAttachedParent = node.attachedPart == this.part.parent;
if (isAttachedParent) {
Expand Down
2 changes: 1 addition & 1 deletion Source/PartDB15x/PartDB/VariantPartScaler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected void MovePart(AttachNode node)
{
Vector3 currentPosition = this.part.partTransform.InverseTransformPoint(node.attachedPart.partTransform.position); // Where we are
Vector3 desiredPosition = currentNodesWithSameId[0].position; // Where we should be
Vector3 deltaPos = desiredPosition - currentPosition - attachedPartNode[0].position;
Vector3 deltaPos = desiredPosition - currentPosition - (attachedPartNode.Length > 0 ? attachedPartNode[0].position : Vector3.zero);

bool isAttachedParent = node.attachedPart == this.part.parent;
if (isAttachedParent) {
Expand Down
2 changes: 1 addition & 1 deletion Source/PartDB18x/PartDB/VariantPartScaler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected void MovePart(AttachNode node)
{
Vector3 currentPosition = this.part.partTransform.InverseTransformPoint(node.attachedPart.partTransform.position); // Where we are
Vector3 desiredPosition = currentNodesWithSameId[0].position; // Where we should be
Vector3 deltaPos = desiredPosition - currentPosition - attachedPartNode[0].position;
Vector3 deltaPos = desiredPosition - currentPosition - (attachedPartNode.Length > 0 ? attachedPartNode[0].position : Vector3.zero);

bool isAttachedParent = node.attachedPart == this.part.parent;
if (isAttachedParent) {
Expand Down

0 comments on commit 2965f4c

Please sign in to comment.