From abda1dc5f4851483bd99c6986677334262f08ea5 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 3 Dec 2016 17:34:40 -0800 Subject: [PATCH] Update data export --- pk3DS/Subforms/Gen7/SMWE.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pk3DS/Subforms/Gen7/SMWE.cs b/pk3DS/Subforms/Gen7/SMWE.cs index aaa1910..c5e1d46 100644 --- a/pk3DS/Subforms/Gen7/SMWE.cs +++ b/pk3DS/Subforms/Gen7/SMWE.cs @@ -328,17 +328,18 @@ private void B_Export_Click(object sender, EventArgs e) { B_Save_Click(sender, e); + Directory.CreateDirectory("encdata"); foreach (var Map in Areas) { byte[][] tabs = new byte[Map.Tables.Count / 2][]; for (int i = 0; i < Map.Tables.Count; i += 2) { - tabs[i] = new byte[4].Concat(Map.Tables[i].Data).Concat(Map.Tables[i + 1].Data).ToArray(); + tabs[i/2] = new byte[4].Concat(Map.Tables[i].Data).Concat(Map.Tables[i + 1].Data).ToArray(); } var packed = mini.packMini(tabs, "EA"); - encdata[Map.FileNumber] = packed; + File.WriteAllBytes(Path.Combine("encdata", Map.FileNumber.ToString()), packed); } - MessageBox.Show("Exported all tables!"); + Util.Alert("Exported all tables!"); } private class Area