Skip to content

Commit

Permalink
Revert "Gave files in archives their paths"
Browse files Browse the repository at this point in the history
This reverts commit 9bbb9cc.
  • Loading branch information
Knuxfan24 committed Aug 2, 2024
1 parent cd58486 commit 9c92450
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions Marathon/Formats/Archive/U8Archive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,33 +132,6 @@ uint ParseEntries(uint u8EntryIndex, U8ArchiveDirectory entries, bool isRoot = f
FileReader = reader
};

// Set up a list of strings to get this file's path, adding this file's name.
List<string> path = new() { name };

// Set up a variable to determine the full path, using this file's parent.
IArchiveData pathSequence = entries;

// Loop until we hit an entry without a parent.
while (pathSequence.Parent != null)
{
// Add this path's name to the list.
path.Add(pathSequence.Name);

// Replace this path with its parent.
pathSequence = pathSequence.Parent;
}

// Reverse the list of strings to get the proper order.
path.Reverse();

// Loop through and remove empty strings from the path.
for (int pathIndex = path.Count - 1; pathIndex >= 0; pathIndex--)
if (path[pathIndex] == "")
path.RemoveAt(pathIndex);

// Set this file's path.
file.Path = string.Join('\\', path);

// Decompress file if requested.
if (ReadMode == ReadMode.CopyToMemory)
file.Decompress();
Expand Down

0 comments on commit 9c92450

Please sign in to comment.