{"action":"reopened","issue":{"url":"https://api.github.com/repos/Starwaster/ProceduralParts/issues/18","repository_url":"https://api.github.com/repos/Starwaster/ProceduralParts","labels_url":"https://api.github.com/repos/Starwaster/ProceduralParts/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/Starwaster/ProceduralParts/issues/18/comments","events_url":"https://api.github.com/repos/Starwaster/ProceduralParts/issues/18/events","html_url":"https://github.com/Starwaster/ProceduralParts/issues/18","id":242967597,"number":18,"title":"Spontaneous explosion on quickload or vessel switch.","user":{"login":"tivec","id":717574,"avatar_url":"https://avatars3.githubusercontent.com/u/717574?v=4","gravatar_id":"","url":"https://api.github.com/users/tivec","html_url":"https://github.com/tivec","followers_url":"https://api.github.com/users/tivec/followers","following_url":"https://api.github.com/users/tivec/following{/other_user}","gists_url":"https://api.github.com/users/tivec/gists{/gist_id}","starred_url":"https://api.github.com/users/tivec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tivec/subscriptions","organizations_url":"https://api.github.com/users/tivec/orgs","repos_url":"https://api.github.com/users/tivec/repos","events_url":"https://api.github.com/users/tivec/events{/privacy}","received_events_url":"https://api.github.com/users/tivec/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-07-14T11:10:38Z","updated_at":"2018-03-28T18:26:46Z","closed_at":null,"author_association":"NONE","body":"Today I have been struggling to find out what was causing numerous exceptions like this one when loading a quicksave or switching to certain vessels, leading to exploding craft:\r\n\r\n> [EXC 12:56:24.512] NullReferenceException: Object reference not set to an instance of an object\r\n> \tPartJoint.SetupJoint (Vector3 jointPos, Vector3 jointOrt, Vector3 jointOrt2, Int32 size)\r\n> \tPartJoint.create (.Part child, .Part parent, UnityEngine.Transform nodeSpace, Vector3 nodePos, Vector3 nodeOrt, Vector3 nodeOrt2, Int32 nodeSize, AttachModes mode, Boolean rigid)\r\n> \tPartJoint.Create (.Part owner, .Part parent, .AttachNode nodeToParent, .AttachNode nodeFromParent, AttachModes mode)\r\n> \tPart.SecureAutoStrut (.Part anchor)\r\n> \tPart+<SecureAutoStruts>c__Iterator3D.MoveNext ()\r\n> \tUnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress)\r\n\r\nMy first suspicion was my use of autostruts (Editor Extensions, mass tweakable set autostrut to root part), so I set them all to disabled, and this seemed to have solved the issue. \r\n\r\nHowever, I dug through the log file and found this:\r\n\r\n> [WRN 12:56:24.206] BoxColliders does not support negative scale or size.\r\n> The effective box size has been forced positive and is likely to give unexpected collision geometry.\r\n> If you absolutely need to use negative scaling you can use the convex MeshCollider. Scene hierarchy path \"proceduralBattery\"\r\n\r\nI removed the procedural battery and set autostrut on all to root, and had no more issues with explosions over several quicksave/quickload cycles.\r\n\r\nTests I have run so far:\r\n- Set entire vessel to AS Root - no procedural parts.\r\n  - Add a procedural battery anywhere on the vessel. Do not set autostrut.\r\n  - Load vessel to runway. Quicksave, quickload => Explosion.\r\n\r\n- Set entire vessel to AS Root - no procedural parts.\r\n  - Add a procedural tank anywhere on the vessel. Do not set autostrut.\r\n  - Load vessel to runway. Quicksave, quickload => Explosion.\r\n\r\n- Set entire vessel to AS Disabled - no procedural parts.\r\n  - Add a procedural tank anywhere on the vessel. Set autostrut to root part\r\n  - Load vessel to runway. Quicksave, quickload => No explosion.\r\n\r\nThis seems to be a problem with autostrut in conjunction with the negative scaling on the MeshCollider.\r\n\r\n[KSP - Autostrut partjoint - negative scale collider.zip](https://github.com/Starwaster/ProceduralParts/files/1148200/KSP.-.Autostrut.partjoint.-.negative.scale.collider.zip)\r\n\r\nAttached is the log file if you wish to investigate. I see a lot of other mods with negative scale colliders, but I can recreate this very easily with ProceduralParts."}}
{"actor":{"display_login":"Starwaster"}}