(AutoEntry): don't return file type for ambiguously detected files.

This commit is contained in:
morkt 2015-11-19 11:35:02 +04:00
parent e23c5ceafc
commit 65ae716469

View File

@ -61,7 +61,10 @@ namespace GameRes.Formats
return new AutoEntry (base_name, () => {
uint signature = file.View.ReadUInt32 (offset);
if (0 == signature) return null;
return FormatCatalog.Instance.LookupSignature (signature).FirstOrDefault();
var res = FormatCatalog.Instance.LookupSignature (signature);
if (!res.Any() || res.Skip (1).Any()) // Count == 0 || Count > 1
return null;
return res.First();
}) { Offset = offset };
}