diff --git a/FerramAerospaceResearch/FARPartGeometry/DebugVisualVoxelSubmesh.cs b/FerramAerospaceResearch/FARPartGeometry/DebugVisualVoxelSubmesh.cs index 5d06b29d8..3d989c829 100644 --- a/FerramAerospaceResearch/FARPartGeometry/DebugVisualVoxelSubmesh.cs +++ b/FerramAerospaceResearch/FARPartGeometry/DebugVisualVoxelSubmesh.cs @@ -72,7 +72,11 @@ public static DebugVisualVoxelSubmesh Create(Transform parent = null, bool activ public bool active { get => gameObject.activeSelf; - set => gameObject?.SetActive(value); + set + { + if (gameObject != null) + gameObject.SetActive(value); + } } public Mesh Mesh diff --git a/FerramAerospaceResearch/FARPartGeometry/GeometryPartModule.cs b/FerramAerospaceResearch/FARPartGeometry/GeometryPartModule.cs index a30d44f1e..e0586048d 100644 --- a/FerramAerospaceResearch/FARPartGeometry/GeometryPartModule.cs +++ b/FerramAerospaceResearch/FARPartGeometry/GeometryPartModule.cs @@ -1022,31 +1022,26 @@ public void Rescale(Vector3 relativeRescaleFactor) public override void OnLoad(ConfigNode node) { base.OnLoad(node); - LoadBool(node, "forceUseColliders", out forceUseColliders); - LoadBool(node, "forceUseMeshes", out forceUseMeshes); - LoadBool(node, "ignoreForMainAxis", out ignoreForMainAxis); - LoadBool(node, "ignoreIfNoRenderer", out ignoreIfNoRenderer); - LoadBool(node, "rebuildOnAnimation", out rebuildOnAnimation); + LoadBool(node, "forceUseColliders", ref forceUseColliders); + LoadBool(node, "forceUseMeshes", ref forceUseMeshes); + LoadBool(node, "ignoreForMainAxis", ref ignoreForMainAxis); + LoadBool(node, "ignoreIfNoRenderer", ref ignoreIfNoRenderer); + LoadBool(node, "rebuildOnAnimation", ref rebuildOnAnimation); LoadList(node, "ignoreTransform", ref ignoredTransforms); LoadList(node, "unignoreTransform", ref unignoredTransforms); } - private void LoadBool(ConfigNode node, string name, out bool value) + private void LoadBool(ConfigNode node, string name, ref bool value) { if (node.HasValue(name)) { bool.TryParse(node.GetValue(name), out value); _ready = false; } - else - { - value = false; - } } private void LoadList(ConfigNode node, string name, ref List list) { - list.Clear(); if (node.HasValue(name)) { foreach (string _name in node.GetValues(name)) diff --git a/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll b/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll index 6ead3fe20..175dd4d64 100644 Binary files a/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll and b/GameData/FerramAerospaceResearch/Plugins/FerramAerospaceResearch.dll differ diff --git a/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll b/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll index 3aa9842c6..7e25f33cc 100644 Binary files a/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll and b/GameData/FerramAerospaceResearch/Plugins/ferramGraph.dll differ diff --git a/README.md b/README.md index fd3b57a7e..008f7db27 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ CHANGELOG ======================================================= -------------------master branch------------------------- +Fix config values reset on load in `GeometryPartModule` [#47](https://github.com/dkavolis/Ferram-Aerospace-Research/pull/47) Fix NRE spam on EVA [#43](https://github.com/dkavolis/Ferram-Aerospace-Research/issues/43) ([#44](https://github.com/dkavolis/Ferram-Aerospace-Research/pull/44)) 0.15.10.0V "Lundgren"------------------------------------ diff --git a/bin/Debug/FerramAerospaceResearch.dll b/bin/Debug/FerramAerospaceResearch.dll index f07919786..175dd4d64 100644 Binary files a/bin/Debug/FerramAerospaceResearch.dll and b/bin/Debug/FerramAerospaceResearch.dll differ diff --git a/bin/Debug/ferramGraph.dll b/bin/Debug/ferramGraph.dll index 7c6c6db66..7e25f33cc 100644 Binary files a/bin/Debug/ferramGraph.dll and b/bin/Debug/ferramGraph.dll differ