Skip to content

Commit

Permalink
Fix liveries
Browse files Browse the repository at this point in the history
  • Loading branch information
GewoonJaap committed Jul 3, 2021
1 parent 8cc2ca9 commit f62b4b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Util/AddonScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ private static List<string> GetInstalledLiveries(string communityFolder)
foreach (string addonDirectory in addonDirectories)
{
string finalDirectory = addonDirectory;
if (!Directory.Exists(addonDirectory + "\\manifest.json")) continue;
if (!File.Exists(addonDirectory + "\\manifest.json")) continue;

JObject manifest = JObject.Parse(File.ReadAllText(addonDirectory + "\\manifest.json"));
Console.WriteLine(addonDirectory + "\\manifest.json");
if (((string)manifest["content_type"])?.ToLower() != "aircraft") continue;
finalDirectory += "\\SimObjects\\Airplanes";

Expand All @@ -42,7 +43,7 @@ private static List<string> GetInstalledLiveries(string communityFolder)
string[] airplaneDirectories = Directory.GetDirectories(finalDirectory);
finalDirectory = airplaneDirectories[0] + "\\aircraft.cfg";

if (!Directory.Exists(finalDirectory)) continue;
if (!File.Exists(finalDirectory)) continue;

liveries.AddRange(ParseCfg(finalDirectory));
}
Expand Down

0 comments on commit f62b4b1

Please sign in to comment.