mirror of
https://github.com/kwsch/pkNX.git
synced 2026-07-10 23:06:02 -05:00
Fix text importing for named textfiles
can't sanity check without filenames; not worth the effort since the text files shouldn't ever be mutated that much.
This commit is contained in:
parent
1f3cbdad71
commit
09d41bbcd9
|
|
@ -114,9 +114,20 @@ private bool ImportTextFiles(string fileName)
|
|||
string[] brokenLine = fileText[i++ + 1].Split(new[] { " : " }, StringSplitOptions.None);
|
||||
if (brokenLine.Length != 2)
|
||||
{ WinFormsUtil.Error($"Invalid Line @ {i}, expected Text File : {ctr}"); return false; }
|
||||
int file = Util.ToInt32(brokenLine[1]);
|
||||
if (file != ctr)
|
||||
{ WinFormsUtil.Error($"Invalid Line @ {i}, expected Text File : {ctr}"); return false; }
|
||||
|
||||
var file = brokenLine[1];
|
||||
if (int.TryParse(file, out var fnum))
|
||||
{
|
||||
if (fnum != ctr)
|
||||
{
|
||||
WinFormsUtil.Error($"Invalid Line @ {i}, expected Text File : {ctr}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// pray that the filename index lines up
|
||||
}
|
||||
i += 2; // Skip over the other header line
|
||||
List<string> Lines = new List<string>();
|
||||
while (i < fileText.Length && fileText[i] != "~~~~~~~~~~~~~~~")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user