Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
fix typos, few missing returns
Browse files Browse the repository at this point in the history
  • Loading branch information
Crzyrndm committed Apr 14, 2016
1 parent 0b89663 commit b301c93
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions FilterExtension/Utility/PartType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
}

/// <summary>
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
}
}
Expand All @@ -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;
Expand Down

0 comments on commit b301c93

Please sign in to comment.