Skip to content

Commit

Permalink
Fixed misleading error messages if a file was not found during pack step
Browse files Browse the repository at this point in the history
Fixed issue with finding mounted games on different drives (by @Donaldduck8)

Co-Authored-By: Donaldduck8 <18058757+Donaldduck8@users.noreply.github.com>
  • Loading branch information
Exactol and Donaldduck8 committed Jan 28, 2023
1 parent aebbc0f commit 29808c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions CompilePalX/Compilers/BSPPack/Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public override void Run(CompileContext context, CancellationToken cancellationT

if (!File.Exists(bspPath))
{
throw new FileNotFoundException();
throw new FileNotFoundException("Could not find BSP", bspPath);
}

outputFile = "BSPZipFiles\\files.txt";
Expand Down Expand Up @@ -398,10 +398,10 @@ public override void Run(CompileContext context, CancellationToken cancellationT
CompilePalLogger.LogLine("---------------------");

}
catch (FileNotFoundException)
catch (FileNotFoundException e)
{
CompilePalLogger.LogCompileError($"Could not find {bspPath}\n",
new Error($"Could not find {bspPath}", ErrorSeverity.Error));
CompilePalLogger.LogCompileError($"Could not find {e.FileName}\n",
new Error($"Could not find {e.FileName}", ErrorSeverity.Error));
}
catch (ThreadAbortException)
{
Expand Down Expand Up @@ -854,7 +854,7 @@ private static List<string> GetMountedGameSourceDirectories(DataBlock mount, Dic
var paths = new Dictionary<string, string?>();
foreach ((string basePath, string steamId) in locations)
{
var installationFolder = new AppManifestParser(Path.Combine(steamAppsPath, $"appmanifest_{steamId}.acf")).GetInstallationDirectory();
var installationFolder = new AppManifestParser(Path.Combine(basePath, $"appmanifest_{steamId}.acf")).GetInstallationDirectory();
paths[steamId] = Path.Combine(basePath, "common", installationFolder);
}

Expand Down

0 comments on commit 29808c1

Please sign in to comment.