the problem is here >> if (file.Name.Contains(armorLowered))
if I ask for "Clothes", then "Light Leather", then "Leather", and finally "Padded"
I should have an output of Clothes, Leather, Light Leather, Padded, but instead I'm getting
Clothes, Light Leather, Light Leather, Padded
// then later...
string filename = Path.GetFileNameWithoutExtension(file.FullName).ToLower();
if (armorLowered == filename) //...
Even better, you could use the File.Exists(string path) static method to avoid the loop completely. If there's a chance for multiple files to be returned (but it doesn't look like it), you could use the GetFiles(...) method of the DirectoryInfo class.