Give an proper error when a file is not found

This commit is contained in:
abcdefg30
2017-02-04 00:45:32 +01:00
parent ad5a9a85f9
commit aa73b19ee2
2 changed files with 9 additions and 2 deletions

View File

@@ -267,9 +267,15 @@ namespace OpenRA.FileSystem
if (s != null)
return true;
// The file should be in an explicit package (but we couldn't find it)
// Thus don't try to find it using the filename (which contains the invalid '|' char)
// This can be removed once the TODO below is resolved
if (explicitSplit > 0)
return false;
// Ask each package individually
// TODO: This fallback can be removed once the filesystem cleanups are complete
var package = mountedPackages.Keys.LastOrDefault(x => x.Contains(filename));
var package = mountedPackages.Keys.LastOrDefault(x => x.Contains(filename));
if (package != null)
{
s = package.GetStream(filename);