use "path" string variable

This commit is contained in:
NintenHero 2024-05-21 10:20:13 -05:00 committed by GitHub
parent c6bef41191
commit 4be341e718
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,6 @@ namespace Ratalaika_Games_Spiller_Engine_Extractor
int unknown1 = br.ReadInt32(); int unknown1 = br.ReadInt32();
int unknown2 = br.ReadInt32(); int unknown2 = br.ReadInt32();
int unknown3 = br.ReadInt32(); int unknown3 = br.ReadInt32();
Directory.CreateDirectory(Path.GetDirectoryName(args[0]) + "\\" + Path.GetFileNameWithoutExtension(args[0]));
MemoryStream fileData = new(); MemoryStream fileData = new();
br.ReadInt16(); br.ReadInt16();
@ -49,11 +48,12 @@ namespace Ratalaika_Games_Spiller_Engine_Extractor
br.Close(); br.Close();
br = new(fileData); br = new(fileData);
string path = Path.GetDirectoryName(args[0]) + "\\" + Path.GetFileNameWithoutExtension(args[0]) + "\\";
foreach(FileTableEntry file in table) foreach(FileTableEntry file in table)
{ {
br.BaseStream.Position = file.end - file.Size; br.BaseStream.Position = file.end - file.Size;
Directory.CreateDirectory(Path.GetDirectoryName(args[0]) + "//" + Path.GetFileNameWithoutExtension(args[0]) + "//" + Path.GetDirectoryName(file.name)); Directory.CreateDirectory(path + Path.GetDirectoryName(file.name));
using FileStream FS = File.Create(Path.GetDirectoryName(args[0]) + "//" + Path.GetFileNameWithoutExtension(args[0]) + "//" + file.name); using FileStream FS = File.Create(path + file.name);
BinaryWriter bw = new(FS); BinaryWriter bw = new(FS);
bw.Write(br.ReadBytes(file.Size)); bw.Write(br.ReadBytes(file.Size));
bw.Close(); bw.Close();