Auto detect mix type.

This commit is contained in:
Paul Chote
2016-01-16 12:12:16 +00:00
parent ce8b03a276
commit cbf2b1984a
2 changed files with 70 additions and 68 deletions

View File

@@ -39,14 +39,7 @@ namespace OpenRA.FileSystem
public IReadOnlyPackage OpenPackage(string filename, string annotation, int order)
{
if (filename.EndsWith(".mix", StringComparison.InvariantCultureIgnoreCase))
{
var type = string.IsNullOrEmpty(annotation)
? PackageHashType.Classic
: FieldLoader.GetValue<PackageHashType>("(value)", annotation);
return new MixFile(this, filename, type, order);
}
return new MixFile(this, filename, order);
if (filename.EndsWith(".zip", StringComparison.InvariantCultureIgnoreCase))
return new ZipFile(this, filename, order);
if (filename.EndsWith(".oramap", StringComparison.InvariantCultureIgnoreCase))