Misbehaviour when attaching symmetry parts
Lisias opened this issue ยท 3 comments
[LOG 01:09:28.657] [KSP-Recall-Resourceful] TRACE: OnAwake mk1-3pod(Clone):FFFA9EF6
[LOG 01:09:28.677] [KSP-Recall-Resourceful] TRACE: OnLoad mk1-3pod:FFFA9EF6 True
[LOG 01:09:28.686] [Crew Assignment]: Part Mk1-3 Command Pod holds 3 crew, but only 0 are available. Auto-hiring is disabled or not allowed at this point.
[LOG 01:09:28.943] [KSP-Recall-Resourceful] TRACE: OnStart mk1-3pod:FFFA9EF6 Editor True
[LOG 01:09:33.348] [KSP-Recall-Resourceful] TRACE: OnAwake fuelTank(Clone):FFFA8112
[LOG 01:09:33.367] [KSP-Recall-Resourceful] TRACE: OnStart fuelTank:FFFA8112 Editor True
[LOG 01:09:34.429] fuelTank added to ship - part count: 2
[LOG 01:09:34.432] [KSP-Recall-Resourceful] TRACE: OnLoad mk1-3pod:FFFA9EF6 True
[LOG 01:09:34.433] [KSP-Recall-Resourceful] TRACE: OnLoad fuelTank:FFFA8112 True
[LOG 01:09:35.333] [KSP-Recall-Resourceful] TRACE: OnAwake fuelTank(Clone):FFFA801C
[LOG 01:09:35.338] [KSP-Recall-Resourceful] TRACE: OnStart fuelTank:FFFA801C Editor True
[LOG 01:09:36.427] fuelTank added to ship - part count: 3
[LOG 01:09:36.427] [KSP-Recall-Resourceful] TRACE: OnLoad mk1-3pod:FFFA9EF6 True
[LOG 01:09:36.428] [KSP-Recall-Resourceful] TRACE: OnLoad fuelTank:FFFA8112 True
[LOG 01:09:36.428] [KSP-Recall-Resourceful] TRACE: OnLoad fuelTank:FFFA801C True
[LOG 01:09:43.299] [KSP-Recall-Resourceful] TRACE: OnAwake fuelTank(Clone):FFFA7F06
[LOG 01:09:43.303] [KSP-Recall-Resourceful] TRACE: OnStart fuelTank:FFFA7F06 Editor True
[LOG 01:09:45.134] [KSP-Recall-Resourceful] TRACE: OnAwake fuelTank(Clone):FFFA7EA8
[LOG 01:09:45.139] [KSP-Recall-Resourceful] TRACE: OnCopy fuelTank:FFFA7EA8 from FFFA7F06
[LOG 01:09:45.142] [KSP-Recall-Resourceful] TRACE: Restoring 0 resources from fuelTank:FFFA7EA8
[LOG 01:09:45.147] [KSP-Recall-Resourceful] TRACE: OnStart fuelTank:FFFA7EA8 Editor True
[LOG 01:09:45.749] [KSP-Recall-Resourceful] TRACE: OnLoad mk1-3pod:FFFA9EF6 True
[LOG 01:09:45.749] [KSP-Recall-Resourceful] TRACE: OnLoad fuelTank:FFFA8112 True
[LOG 01:09:45.749] [KSP-Recall-Resourceful] TRACE: OnLoad fuelTank:FFFA801C True
[LOG 01:09:45.749] [KSP-Recall-Resourceful] TRACE: OnLoad fuelTank:FFFA7F06 True
[LOG 01:09:45.750] [KSP-Recall-Resourceful] TRACE: OnLoad fuelTank:FFFA7EA8 True
[EXC 01:09:46.267] NullReferenceException: Object reference not set to an instance of an object
UIPartActionResourceItem.SetSymCounterpartsAmount (System.Double amount) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionResourceEditor.onSliderChangeProcess () (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionResourceEditor.Setup (UIPartActionWindow window, Part part, UI_Scene scene, UI_Control control, PartResource resource) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionWindow.AddResourceEditorControl (PartResource r) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionWindow.SetupResourceControls (PartResource r, System.Boolean clearFirst, UI_Scene scene, System.Int32& controlIndex) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionWindow.CreatePartList (System.Boolean clearFirst) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionWindow.Setup (Part part, UIPartActionWindow+DisplayType type, UI_Scene scene) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionController.CreatePartUI (Part part, UIPartActionWindow+DisplayType type, UI_Scene scene) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionController.SelectPart (Part part, System.Boolean allowMultiple, System.Boolean overrideSymmetry) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionController.HandleMouseClick (UnityEngine.Camera cam, System.Boolean allowMultiple) (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UIPartActionController+<MouseClickCoroutine>d__37.MoveNext () (at <48dcb08e2e1542e2af1286b02d2eb072>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <7d9ec060e791409ab3eb85c61e312ed6>:0)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
<lots of the same exception>
<user clicks New, then exit Editor>
[LOG 01:09:59.002] [KSP-Recall-Resourceful] TRACE: OnDestroy mk1-3pod:FFFA9EF6
[LOG 01:09:59.002] [KSP-Recall-Resourceful] TRACE: OnDestroy fuelTank:FFFA8112
[LOG 01:09:59.002] [KSP-Recall-Resourceful] TRACE: OnDestroy fuelTank:FFFA801C
[LOG 01:09:59.002] [KSP-Recall-Resourceful] TRACE: OnDestroy fuelTank:FFFA7F06
[LOG 01:09:59.002] [KSP-Recall-Resourceful] TRACE: OnDestroy fuelTank:FFFA7EA8
This vessel appears to contradict this post...
Stupid mistake fixed. (pretty lame, to tell the true).
The OnCopy method was creating empty resource caches for new, vanilla parts. And so, the Cloning mechanism was assuming that it was handling a part without resources, and were deleting the resources of the cloned part - by then, KSP borked because it was running on a procedure that was pretty sure there were resources on that part.
Fixed on commit 486b38b