AutoEntry.Offset set in constructor now.

This commit is contained in:
morkt 2015-04-16 22:41:03 +04:00
parent f5d2cac377
commit 127a2bcf4d
2 changed files with 1 additions and 3 deletions

View File

@ -120,8 +120,7 @@ namespace GameRes.Formats.KAAS
if (!is_voice) if (!is_voice)
entry = AutoEntry.Create (file, offset, i.ToString ("D4")); entry = AutoEntry.Create (file, offset, i.ToString ("D4"));
else else
entry = new Entry { Name = string.Format ("{0:D4}.pb", i), Type = "archive" }; entry = new Entry { Name = string.Format ("{0:D4}.pb", i), Type = "archive", Offset = offset };
entry.Offset = offset;
entry.Size = file.View.ReadUInt32 (index_offset + 4); entry.Size = file.View.ReadUInt32 (index_offset + 4);
if (!entry.CheckPlacement (file.MaxOffset)) if (!entry.CheckPlacement (file.MaxOffset))
return null; return null;

View File

@ -64,7 +64,6 @@ namespace GameRes.Formats.MnoViolet
index_offset += name_size; index_offset += name_size;
uint offset = file.View.ReadUInt32 (index_offset+4); uint offset = file.View.ReadUInt32 (index_offset+4);
var entry = AutoEntry.Create (file, offset, name); var entry = AutoEntry.Create (file, offset, name);
entry.Offset = offset;
entry.Size = file.View.ReadUInt32 (index_offset); entry.Size = file.View.ReadUInt32 (index_offset);
if (offset <= index_size || !entry.CheckPlacement (file.MaxOffset)) if (offset <= index_size || !entry.CheckPlacement (file.MaxOffset))
return null; return null;