Skip to content

Commit

Permalink
Sting pack file can contain subfolders
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Sep 12, 2024
1 parent 85e64b8 commit 64f61f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion HyoutaToolsLib/Sting/PcPckFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public static void Extract(DuplicatableStream file, string destination) {
string filename = file.ReadSizedString(0x40, TextUtils.GameTextEncoding.ShiftJIS).TrimNull();
uint length = file.ReadUInt32();
uint offset = file.ReadUInt32();
using (FileStream newFile = new FileStream(System.IO.Path.Combine(destination, filename), FileMode.Create)) {
string destPath = System.IO.Path.Combine(destination, filename);
System.IO.Directory.CreateDirectory(Path.GetDirectoryName(destPath));
using (FileStream newFile = new FileStream(destPath, FileMode.Create)) {
long p = file.Position;
file.Position = offset;
StreamUtils.CopyStream(file, newFile, length);
Expand Down

0 comments on commit 64f61f7

Please sign in to comment.