From 662ba87a4e983d700cd1cdd14280a1a065ee1dd7 Mon Sep 17 00:00:00 2001 From: siimav Date: Mon, 11 Dec 2023 00:31:58 +0200 Subject: [PATCH] Fix ImpactCB parameter exception --- Source/CC_RP0/Parameter/ImpactCBParam.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/CC_RP0/Parameter/ImpactCBParam.cs b/Source/CC_RP0/Parameter/ImpactCBParam.cs index 892f63ded3a..139d7db2aa6 100644 --- a/Source/CC_RP0/Parameter/ImpactCBParam.cs +++ b/Source/CC_RP0/Parameter/ImpactCBParam.cs @@ -40,14 +40,17 @@ protected override void OnParameterSave(ConfigNode node) base.OnParameterSave(node); node.AddValue("minSrfVel", minSrfVel); - node.AddValue("targetBody", targetBody.name); + if (targetBody != null) // to prevent an exception being thrown due to a mistake that made it into previous release + { + node.AddValue("targetBody", targetBody.name); + } } protected override void OnParameterLoad(ConfigNode node) { base.OnParameterLoad(node); - minSrfVel = ConfigNodeUtil.ParseNode(node, "minSrfVel"); + minSrfVel = ConfigNodeUtil.ParseValue(node, "minSrfVel"); targetBody = ConfigNodeUtil.ParseValue(node, "targetBody", null); }