Project

General

Profile

Bug #13622

allowRoot is not taken into account in flight

Added by Nils277 over 7 years ago.

Status:
New
Severity:
Normal
Assignee:
-
Category:
Physics
Target version:
-
Start date:
01/19/2017
% Done:

0%

Version:
Platform:
Windows
Expansion:
Language:
English (US)
Mod Related:
No
Votes:
Arrow u r green
Arrow d r red

Description

When the 8.th (allowRoot) paramter of the attachrules in a parts config is set to 0 it prevents this part from becoming the root of the vessel in the Editor.

This is not taken into account in flight however where it can become root. The same applies to physicsless parts which are also able to become root of the vessel in flight.
In both cases this is unfavorable because the main reasons for a part to not be root are in flight and not in the editor.

Steps to reproduce:
  1. Use any docking port of your choice and set the 8.th parameter of its attachrules to 0
  2. The docking port is now unable to become root in the editor
  3. Create a vessel where two docking ports are attached to each other.
  4. Launch the craft and decouble the docking port.
  5. The docking port that is further away from the original root of the vessel is now the root of the newly created vessel although it shouldn't be.

To see if a part is the root you can use this code for a partmodule:

class RootTest: PartModule
    {
[KSPField(isPersistant = false, guiActive = true, guiActiveEditor = true, guiName = "Is Root:")]
public bool isRoot = false;
public void Update() {
isRoot = (part.parent == null)
}
}

It is clear that when a vessel is destroyed and there is only one part left that this part must be the root. In any other case and especially the really common docking this can cause many problems.

Also available in: Atom PDF