From 7c9e1fc57d518346f26bcb28e920d42fd7e6c555 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Fri, 11 Nov 2022 22:10:21 +0100 Subject: [PATCH] Improved multiline property import --- PCK-Studio/MainForm.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index 469c4eaf..9a3520ad 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -1865,14 +1865,17 @@ namespace PckStudio { foreach (var line in input.TextOutput) { - file.properties.Add((line.Substring(0, line.IndexOf(' ')), line.Substring(line.IndexOf(' ') + 1))); + int idx = line.IndexOf(' '); + if (idx == -1 || line.Length - 1 == idx) + continue; + file.properties.Add((line.Substring(0, idx), line.Substring(idx + 1))); + } ReloadMetaTreeView(); saved = false; } } } } - } private void correctSkinDecimalsToolStripMenuItem_Click(object sender, EventArgs e) {