Fix build

This commit is contained in:
Matt Nadareski
2024-04-23 21:49:57 -04:00
parent af40c78b56
commit e38ecaec4c
3 changed files with 5 additions and 5 deletions

View File

@@ -317,7 +317,7 @@ namespace SabreTools.Serialization.Deserializers
return null;
// TEMPORARY FIX FOR ASCII -> UNICODE
directoryEntry.Name = Encoding.Unicode.GetString(Encoding.ASCII.GetBytes(directoryEntry.Name));
directoryEntry.Name = Encoding.Unicode.GetString(Encoding.ASCII.GetBytes(directoryEntry.Name!));
// Handle version 3 entries
if (majorVersion == 3)

View File

@@ -427,10 +427,10 @@ namespace SabreTools.Serialization.Deserializers
/// <param name="data">Stream to parse</param>
/// <param name="endOffset">First address not part of the imported-name table</param>
/// <returns>Filled imported-name table on success, null on error</returns>
public static Dictionary<ushort, ImportedNameTableEntry?>? ParseImportedNameTable(Stream data, int endOffset)
public static Dictionary<ushort, ImportedNameTableEntry>? ParseImportedNameTable(Stream data, int endOffset)
{
// TODO: Use marshalling here instead of building
var importedNameTable = new Dictionary<ushort, ImportedNameTableEntry?>();
var importedNameTable = new Dictionary<ushort, ImportedNameTableEntry>();
while (data.Position < endOffset)
{

View File

@@ -57,7 +57,7 @@ namespace SabreTools.Serialization.Wrappers
Encrypted = directoryEntry.DirectoryFlags.HasFlag(Models.GCF.HL_GCF_FLAG.HL_GCF_FLAG_ENCRYPTED),
#endif
};
var pathParts = new List<string> { directoryEntry.Name ?? string.Empty };
var pathParts = new List<string> { this.Model.DirectoryNames![directoryEntry.NameOffset] ?? string.Empty };
var blockEntries = new List<Models.GCF.BlockEntry?>();
// Traverse the parent tree
@@ -68,7 +68,7 @@ namespace SabreTools.Serialization.Wrappers
if (parentDirectoryEntry == null)
break;
pathParts.Add(parentDirectoryEntry.Name ?? string.Empty);
pathParts.Add(this.Model.DirectoryNames![parentDirectoryEntry.NameOffset] ?? string.Empty);
index = parentDirectoryEntry.ParentIndex;
}