public override void Destroy() { //UnsetModuleStructuralNode(nodes[0], structNodeMan[0]); //UnsetModuleStructuralNode(nodes[1], structNodeMan[1]); base.Destroy(); ConnectedLivingSpacesCompatibility.RequestRemoveConnection(parts[0], parts[1]); ReCouplerUtils.onReCouplerEditorJointBroken.Fire(new GameEvents.FromToAction <Part, Part>(this.parts[0], this.parts[1])); GameEvents.onEditorShipModified.Fire(EditorLogic.fetch.ship); }
public override void Destroy() { if (_isTrackingDockingPorts) { return; } log.debug("Destroying a link."); if (joint != null) { GameObject.Destroy(joint); } base.Destroy(); if (oldCrossfeedSets.Count > 0) { parts[0].crossfeedPartSet = oldCrossfeedSets[0]; parts[1].crossfeedPartSet = oldCrossfeedSets[1]; } UnsetModuleStructuralNode(nodes[0], structNodeMan[0]); UnsetModuleStructuralNode(nodes[1], structNodeMan[1]); if (this.parts[0] != null && this.parts[1] != null) { ConnectedLivingSpacesCompatibility.RequestRemoveConnection(this.parts[0], this.parts[1]); } if (this.parts[0] != null) { ReCouplerUtils.onReCouplerJointBroken.Fire(new GameEvents.HostedFromToAction <Vessel, Part>(this.parts[0].vessel, this.parts[0], this.parts[1])); } else if (this.parts[1] != null) { ReCouplerUtils.onReCouplerJointBroken.Fire(new GameEvents.HostedFromToAction <Vessel, Part>(this.parts[1].vessel, this.parts[0], this.parts[1])); } else { ReCouplerUtils.onReCouplerJointBroken.Fire(new GameEvents.HostedFromToAction <Vessel, Part>(null, this.parts[0], this.parts[1])); } if (parts[0] != null && parts[0].vessel != null) { GameEvents.onVesselWasModified.Fire(parts[0].vessel); } else if (parts[1] != null && parts[1].vessel != null) { GameEvents.onVesselWasModified.Fire(parts[1].vessel); } }