(DSK): ignore empty entries.

This commit is contained in:
morkt 2018-01-11 20:21:29 +04:00
parent dabed60304
commit eb8e7598a0

View File

@ -51,6 +51,9 @@ namespace GameRes.Formats.Abogado
{ "SOUND", "ADP" }, { "SOUND", "ADP" },
{ "PCM1", "ADP" }, { "PCM1", "ADP" },
{ "PCM2", "ADP" }, { "PCM2", "ADP" },
{ "PCM", "ADP" },
{ "GRAPHIC", "KG" },
{ "SCENARIO", "SCF" },
}; };
public override ArcFile TryOpen (ArcView file) public override ArcFile TryOpen (ArcView file)
@ -76,14 +79,17 @@ namespace GameRes.Formats.Abogado
for (int i = 0; i < count; ++i) for (int i = 0; i < count; ++i)
{ {
var name = pft.ReadCString (8); var name = pft.ReadCString (8);
if (!string.IsNullOrEmpty (ext)) if (name.Length > 0)
name = Path.ChangeExtension (name, ext); {
var entry = FormatCatalog.Instance.Create<Entry> (name); if (!string.IsNullOrEmpty (ext))
entry.Offset = cluster_size * (long)pft.ReadUInt32(); name = Path.ChangeExtension (name, ext);
entry.Size = pft.ReadUInt32(); var entry = FormatCatalog.Instance.Create<Entry> (name);
if (!entry.CheckPlacement (file.MaxOffset)) entry.Offset = cluster_size * (long)pft.ReadUInt32();
return null; entry.Size = pft.ReadUInt32();
dir.Add (entry); if (!entry.CheckPlacement (file.MaxOffset))
return null;
dir.Add (entry);
}
} }
return new ArcFile (file, this, dir); return new ArcFile (file, this, dir);
} }