diff --git a/FilterExtension/Utility/PartType.cs b/FilterExtension/Utility/PartType.cs index dac61b53..057eabb1 100644 --- a/FilterExtension/Utility/PartType.cs +++ b/FilterExtension/Utility/PartType.cs @@ -78,7 +78,7 @@ public static bool checkCategory(AvailablePart part, string[] value) return true; break; case PartCategories.Control: - if (value.Contains("Command and Control", comparer)) + if (value.Contains("Control", comparer)) return true; break; case PartCategories.Structural: @@ -333,7 +333,7 @@ public static bool checkName(AvailablePart part, string[] value) public static bool checkTitle(AvailablePart part, string[] value) { - return value.Any(s => part.title.IndexOf(s, StringComparison.InvariantCultureIgnoreCase) != -1); + return value.Any(s => part.title.IndexOf(s, StringComparison.OrdinalIgnoreCase) != -1); } /// @@ -397,7 +397,7 @@ public static bool checkPath(AvailablePart part, string[] value) { string path; if (Core.Instance.partPathDict.TryGetValue(part.name, out path)) - return value.Any(s => path.StartsWith(s, StringComparison.InvariantCultureIgnoreCase)); + return value.Any(s => path.StartsWith(s, StringComparison.OrdinalIgnoreCase)); return false; } @@ -491,7 +491,7 @@ public static bool checkMass(AvailablePart part, string[] value, ConfigNodes.Che return false; if (equality == ConfigNodes.Check.Equality.Equals) - value.Contains(part.partPrefab.mass.ToString(), comparer); + return value.Contains(part.partPrefab.mass.ToString(), comparer); else { double d; @@ -512,7 +512,7 @@ public static bool checkMass(AvailablePart part, string[] value, ConfigNodes.Che public static bool checkCost(AvailablePart part, string[] value, ConfigNodes.Check.Equality equality) { if (equality == ConfigNodes.Check.Equality.Equals) - value.Contains(part.cost.ToString(), comparer); + return value.Contains(part.cost.ToString(), comparer); else { double d; @@ -536,15 +536,15 @@ public static bool checkCrashTolerance(AvailablePart part, string[] value, Confi return false; if (equality == ConfigNodes.Check.Equality.Equals) - value.Contains(part.partPrefab.crashTolerance.ToString(), comparer); + return value.Contains(part.partPrefab.crashTolerance.ToString()); else { - double d; - if (double.TryParse(value[0], out d)) + float f; + if (float.TryParse(value[0], out f)) { - if (equality == ConfigNodes.Check.Equality.GreaterThan && part.partPrefab.crashTolerance > d) + if (equality == ConfigNodes.Check.Equality.GreaterThan && part.partPrefab.crashTolerance > f) return true; - else if (equality == ConfigNodes.Check.Equality.LessThan && part.partPrefab.crashTolerance < d) + else if (equality == ConfigNodes.Check.Equality.LessThan && part.partPrefab.crashTolerance < f) return true; } } @@ -560,7 +560,7 @@ public static bool checkTemperature(AvailablePart part, string[] value, ConfigNo return false; if (equality == ConfigNodes.Check.Equality.Equals) - value.Contains(part.partPrefab.maxTemp.ToString(), comparer); + return value.Contains(part.partPrefab.maxTemp.ToString(), comparer); else { double d;