chore: code enhancement

This commit is contained in:
scientificworld
2026-01-07 12:02:14 +08:00
parent 7909b5b641
commit 25f06a1c98
2 changed files with 15 additions and 5 deletions

View File

@@ -42,8 +42,11 @@ namespace GameRes.Formats.Duke
public override ArcFile TryOpen (ArcView file)
{
if (!file.Name.HasExtension (".dat"))
return null;
int count = (int)(file.View.ReadUInt32 (0) ^ 0xfa261efb);
if (!file.Name.HasExtension (".dat") || !IsSaneCount (count))
if (!IsSaneCount (count))
return null;
uint index_offset = 4;