diff --git a/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs b/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs index 208282ee..c4d22e4f 100644 --- a/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs +++ b/pkNX.Structures/Encounter/Gen8/FlatStatic/EncounterStatic8.cs @@ -1,4 +1,3 @@ -using Newtonsoft.Json; using System.Collections.Generic; namespace pkNX.Structures diff --git a/pkNX.Structures/TableUtil.cs b/pkNX.Structures/TableUtil.cs index 1e6fa748..10e7d078 100644 --- a/pkNX.Structures/TableUtil.cs +++ b/pkNX.Structures/TableUtil.cs @@ -42,7 +42,7 @@ public static string GetNamedTypeTable(IList arr, IList names, str list[0] = $"Index{sep}{name ?? t.Name}{sep}{list[0]}"; // slap in row name to row - for (int i = 1; i < list.Length; i++) + for (int i = 1; i < names.Count + 1; i++) list[i] = $"{i - 1}{sep}{names[i - 1]}{sep}{list[i]}"; return string.Join(Environment.NewLine, list); diff --git a/pkNX.WinForms/Dumping/GameDumperSWSH.cs b/pkNX.WinForms/Dumping/GameDumperSWSH.cs index da661eca..808b140d 100644 --- a/pkNX.WinForms/Dumping/GameDumperSWSH.cs +++ b/pkNX.WinForms/Dumping/GameDumperSWSH.cs @@ -179,8 +179,8 @@ public void DumpTrainers() var t = tr[i]; // some battles with Avery and Klara have out of bounds trclasses -- set back to "Pokémon Trainer" - if (t.Self.Class == 250 || t.Self.Class == 251) - t.Self.Class = 219; + if (t.Self.Class > trc.Length) + t.Self.Class = 1; result.Add($"{i:000} - {trc[t.Self.Class]}: {trn[i]}"); const int MoneyScalar = 80; diff --git a/pkNX.WinForms/Subforms/BTTE.cs b/pkNX.WinForms/Subforms/BTTE.cs index 8834dc82..d2be4941 100644 --- a/pkNX.WinForms/Subforms/BTTE.cs +++ b/pkNX.WinForms/Subforms/BTTE.cs @@ -478,6 +478,9 @@ private string GetTrainerString(VsTrainer Trainer) var name = Trainer.Name; var team = Trainer.Team; var sb = new StringBuilder(); + if (tr.Class > trClass.Length) // Klara and Avery out of bounds trclass edge case + tr.Class = 1; + sb.AppendLine("======"); sb.Append(file).Append(" - ").Append(trClass[tr.Class]).Append(" ").AppendLine(name); sb.AppendLine("======");