Skip to content

Commit

Permalink
fix exception
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKell authored Sep 9, 2023
1 parent 48e4abe commit 52a7d76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ protected override void OnParameterLoad(ConfigNode node)
maxExperience = Convert.ToInt32(node.GetValue("maxExperience"));
minCrew = Convert.ToInt32(node.GetValue("minCrew"));
maxCrew = Convert.ToInt32(node.GetValue("maxCrew"));
crewOnly = ConfigNodeUtil.ParseValue<bool>(node, "crewOnly", false);
string cO = node.GetValue("crewOnly");
crewOnly = cO != null && cO.ToLowerInvariant() == "true";

foreach (ConfigNode kerbalNode in node.GetNodes("KERBAL"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public override bool Load(ConfigNode configNode)
valid &= ConfigNodeUtil.ParseValue<int>(configNode, "maxExperience", x => maxExperience = x, this, 5, x => Validation.Between(x, 0, 5));
valid &= ConfigNodeUtil.ParseValue<int>(configNode, "minCrew", x => minCrew = x, this, 1, x => Validation.GE(x, 0));
valid &= ConfigNodeUtil.ParseValue<int>(configNode, "maxCrew", x => maxCrew = x, this, int.MaxValue, x => Validation.GE(x, minCrew));
valid &= ConfigNodeUtil.ParseValue<bool>(configNode, "crewOnly", x => crewOnly = x, this, false);
string cO = configNode.GetValue("crewOnly");
crewOnly = cO != null && cO.ToLowerInvariant() == "true";

valid &= ConfigNodeUtil.ParseValue<List<Kerbal>>(configNode, "kerbal", x => kerbal = x, this, new List<Kerbal>());
valid &= ConfigNodeUtil.ParseValue<List<Kerbal>>(configNode, "excludeKerbal", x => excludeKerbal = x, this, new List<Kerbal>());
Expand Down

0 comments on commit 52a7d76

Please sign in to comment.